]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Fix bug #12327 with SIGCHLD handling on Windows and some other systems.
[gnu-emacs] / src / ChangeLog
1 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2
3 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
4 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5
6 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7
8 Explicitly mark buffer_defaults and buffer_local_symbols.
9 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
10 mark_local_symbols here.
11 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
12 since special buffers aren't marked here any more.
13 (allocate_buffer): Chain new buffer with all_buffers here...
14 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
15 not here.
16 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
17 (syms_of_buffer): Remove staticpro of the above.
18 (init_buffer_once): Set names for buffer_defaults and
19 buffer_local_symbols.
20
21 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
22
23 Use bool for booleans in font-related modules.
24 * font.c (font_intern_prop, font_style_to_value)
25 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
26 (generate_otf_features, font_check_otf_features, font_check_otf)
27 (font_match_p, font_list_entities, font_at):
28 * fontset.c (fontset_id_valid_p, reorder_font_vector
29 (fontset_find_font, Fset_fontset_font)
30 (face_suitable_for_char_p) [0]:
31 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
32 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
33 (m17n_flt_initialized, ftfont_shape_by_flt):
34 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
35 * nsfont.m (nsfont_draw):
36 * w32font.c (w32font_draw):
37 * w32term.c (x_draw_glyphless_glyph_string_foreground):
38 Use bool for booleans.
39 * font.h: Adjust to above API changes.
40 (struct font, struct font_driver, struct font_driver_list):
41 Use bool for booleans.
42 (struct font): Remove useless member encoding_type.
43 All users removed.
44 * fontset.c, xftfont.c: Omit unnecessary static decls.
45
46 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
47
48 * alloc.c (mark_object): Revert window marking code
49 since it's unsafe for the Fset_window_configuration.
50
51 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
52
53 Fix race conditions with signal handlers and errno.
54 Be more systematic about preserving errno whenever a signal
55 handler returns, even if it's not in the main thread. Do this by
56 renaming signal handlers to distinguish between signal delivery
57 and signal handling. All uses changed.
58 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
59 * data.c (deliver_arith_signal): Rename from arith_error.
60 * dispnew.c (deliver_window_change_signal): Rename from
61 window_change_signal.
62 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
63 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
64 * keyboard.c (deliver_input_available_signal): Rename from
65 input_available_signal.
66 (deliver_user_signal): Rename from handle_user_signal.
67 (deliver_interrupt_signal): Rename from interrupt_signal.
68 * process.c (deliver_pipe_signal): Rename from send_process_trap.
69 (deliver_child_signal): Rename from sigchld_handler.
70 * atimer.c (handle_alarm_signal):
71 * data.c (handle_arith_signal):
72 * dispnew.c (handle_window_change_signal):
73 * emacs.c (handle_fatal_signal, handle_danger_signal):
74 * keyboard.c (handle_input_available_signal):
75 * keyboard.c (handle_user_signal, handle_interrupt_signal):
76 * process.c (handle_pipe_signal, handle_child_signal):
77 New functions, with the actual signal-handling code taken from the
78 original respective signal handlers, sans the sporadic attempts to
79 preserve errno, since that's now done by handle_on_main_thread.
80 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
81 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
82 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
83 Move to sysdep.c.
84 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
85 Move initialization of main_thread to sysdep.c's init_signals.
86 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
87 our usage, and simplifies the mainline code.
88 (record_child_status_change): New static function, as a helper
89 for handle_child_signal, and with most of the old child handler's
90 contents.
91 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
92 (handle_child_signal): Use the above.
93 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
94 Moved here from emacs.c.
95 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
96 code moved here from emacs.c's main function.
97 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
98 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
99 lets callers save and restore errno properly.
100
101 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
102
103 Remove redundant or unused things here and there.
104 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
105 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
106 * editfns.c (Fcompare_buffer_substrings): Likewise.
107 * frame.h (struct terminal, struct font_driver_list):
108 Remove redundant declarations.
109 * window.h (Qleft, Qright): Likewise.
110
111 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
112
113 Do not mark objects from deleted buffers, windows and frames.
114 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
115 (mark_object): Likewise for windows and frames.
116
117 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
118
119 * alloc.c (valid_lisp_object_p): Treat killed buffers,
120 buffer_defaults and buffer_local_symbols as valid objects.
121 Return special value to denote them.
122
123 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
124
125 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
126 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
127 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
128 (file_name_absolute_p, Fsubstitute_in_file_name):
129 (check_executable, check_writable, Ffile_accessible_directory_p)
130 (Fset_file_selinux_context, Fdefault_file_modes)
131 (Finsert_file_contents, choose_write_coding_system)
132 (Fwrite_region, build_annotations, a_write, e_write)
133 (Fdo_auto_save):
134 * filelock.c (boot_time_initialized, get_boot_time)
135 (get_boot_time_1, lock_file_1, within_one_second):
136 * floatfns.c (in_float):
137 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
138 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
139 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
140 * lisp.h (struct Lisp_Hash_Table.cmpfn):
141 * window.c (compare_window_configurations):
142 Use bool for booleans.
143 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
144 (Fdefault_file_modes): Now mode_t, not int, for modes.
145 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
146 (internal_delete_file): Now returns void, not a (boolean) int,
147 since nobody was looking at the return value.
148 * lisp.h, window.h: Adjust to above API changes.
149
150 * xdisp.c (set_message): Simplify and reindent last change.
151
152 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
153
154 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
155
156 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
157
158 * eval.c (call_debugger): Make the function non-static so that we
159 can call it from set_message.
160
161 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
162 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
163
164 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
165
166 Give more-useful info on a fatal error (Bug#12328).
167 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
168 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
169 of doing the work ourselves.
170 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
171 do most of the work.
172 (fatal_error_backtrace): New function, taken from the guts
173 of the old fatal_error_signal, but with a new option to output
174 a backtrace.
175 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
176 info about the signal than just its number.
177 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
178 * sysdep.c: Include <execinfo.h>
179 (emacs_backtrace): New function, taken partly from the previous
180 code of the 'die' function.
181 (emacs_abort): Call fatal_error_backtrace rather than abort.
182
183 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
184
185 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
186 eager (load-time) macro-expansion.
187 * lisp.mk (lisp): Add macroexp.
188
189 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
190
191 Simplify redefinition of 'abort' (Bug#12316).
192 Do not try to redefine the 'abort' function. Instead, redo
193 the code so that it calls 'emacs_abort' rather than 'abort'.
194 This removes the need for the NO_ABORT configure-time macro
195 and makes it easier to change the abort code to do a backtrace.
196 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
197 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
198 Remove; sysdep.c's emacs_abort now takes its place.
199 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
200 'abort' changed to use 'emacs_abort'.
201 * msdos.c (dos_abort) [defined abort]: Remove; not used.
202 (abort) [!defined abort]: Rename to ...
203 (emacs_abort): ... new name.
204 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
205 the place of the old 'abort' in emacs.c.
206 * w32.c, w32fns.c (abort): Do not #undef.
207 * w32.c (emacs_abort): Rename from w32_abort.
208
209 2012-09-04 Eli Zaretskii <eliz@gnu.org>
210
211 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
212 offsets[j].dv, since the y axis of the screen coordinates points
213 down, while the y axis of the font definition coordinates points
214 up. This fixes display of Arabic diacritics such as KASRA and
215 KASRATAN. (Bug#11860)
216
217 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
218
219 Be more systematic about _setjmp vs setjmp.
220 * alloc.c (test_setjmp, mark_stack):
221 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
222 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
223 (png_load, my_error_exit, jpeg_load):
224 * process.c (send_process_trap, send_process):
225 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
226 The underscored versions are up to 30x faster on some hosts.
227 Formerly, the code used setjmp+longjmp sometimes and
228 _setjmp+_longjmp at other times, with no particular reason to
229 prefer setjmp+longjmp.
230
231 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
232
233 Fix minor problem found by static checking.
234 * buffer.c (Fdelete_all_overlays): Return nil.
235
236 2012-09-03 Martin Rudalics <rudalics@gmx.at>
237
238 * buffer.c (Fdelete_all_overlays): New function.
239
240 2012-09-03 Chong Yidong <cyd@gnu.org>
241
242 * gtkutil.c: Add extern decl for Qxft.
243
244 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
245
246 * emacs.c, eval.c: Use bool for boolean.
247 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
248 (malloc_using_checking) [DOUG_LEA_MALLOC]:
249 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
250 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
251 (main, decode_env_path, Fdaemon_initialized):
252 * eval.c (call_debugger, Finteractive_p, interactive_p):
253 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
254 (maybe_call_debugger, Fbacktrace):
255 * process.c (read_process_output, exec_sentinel):
256 Use bool for booleans.
257 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
258 All callers changed.
259 * eval.c (interactive_p): Omit always-true boolean argument
260 EXCLUDE_SUBRS_P. All callers changed.
261 * dispextern.h, lisp.h: Reflect above API changes.
262 * firstfile.c (dummy): Use the address of 'main', whose signature
263 won't change, instead of the address of 'initialize', whose
264 signature just changed from int to bool.
265 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
266 * msdos.c (fatal_error_in_progress): ... from here.
267 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
268 of incrementing it.
269 (redisplay_internal, unwind_redisplay): Simply clear
270 REDISPLAYING_P when unwinding, instead of saving its previous,
271 always-false value and then restoring it.
272
273 Clean up some extern decls.
274 Mostly, this hoists extern decls out of .c files and into .h files.
275 That way, we're more likely to catch errors if the interfaces change.
276 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
277 declare xg_mark_data.
278 * dispextern.h (x_frame_parm_handlers):
279 * font.h (Qxft):
280 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
281 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
282 (Qultra_bold, Qoblique, Qitalic):
283 Move extern decl here from .c file.
284 * alloc.c (xg_mark_data) [USE_GTK]:
285 * doc.c (Qclosure):
286 * eval.c (Qlexical_binding):
287 * fns.c (time) [!HAVE_UNISTD_H]:
288 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
289 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
290 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
291 * lread.c (Qinternal_interpreter_environment):
292 * minibuf.c (Qbuffer):
293 * process.c (QCfamily, QCfilter):
294 * widget.c (free_frame_faces):
295 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
296 * xfont.c (x_clear_errors):
297 * xterm.c (x_frame_parm_handlers):
298 Remove now-redundant extern decls.
299 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
300 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
301 Now static.
302 * xfaces.c: Remove unnecessary static decls.
303 * xterm.c (updating_frame): Remove decl of nonexistent object.
304
305 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
306 when building globals.h, as the objects that are not built on
307 this host are not needed to compile C files on this host.
308
309 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
310
311 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
312
313 * frame.h: Add missing prototype for x_wm_set_size_hint.
314
315 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
316
317 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
318 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
319 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
320 (Fsubstitute_command_keys):
321 * editfns.c (region_limit, find_field, Fconstrain_to_field)
322 (save_excursion_save, save_excursion_restore)
323 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
324 (format_time_string, general_insert_function)
325 (make_buffer_string, make_buffer_string_both)
326 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
327 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
328 (copy_text, insert_1, insert_1_both, insert_from_string)
329 (insert_from_string_before_markers, insert_from_string_1)
330 (insert_from_buffer, insert_from_buffer_1, replace_range)
331 (replace_range_2, del_range_1, del_range_byte, del_range_both)
332 (del_range_2, modify_region):
333 * intervals.c (intervals_equal, balance_possible_root_interval)
334 (adjust_intervals_for_insertion, merge_properties_sticky)
335 (graft_intervals_into_buffer, lookup_char_property)
336 (adjust_for_invis_intang, set_point_both)
337 (get_property_and_range, compare_string_intervals)
338 (set_intervals_multibyte_1, set_intervals_multibyte):
339 * keyboard.c (decode_timer):
340 Use bool for boolean.
341 * intervals.h, lisp.h, systime.h: Reflect above API changes.
342 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
343
344 2012-09-02 Chong Yidong <cyd@gnu.org>
345
346 * keymap.c (push_key_description): Print M-TAB as C-M-i
347 (Bug#11758).
348
349 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
350
351 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
352 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
353 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
354 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
355 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
356 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
357 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
358
359 2012-09-01 Eli Zaretskii <eliz@gnu.org>
360
361 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
362 more than one grapheme cluster passed to the shaper: compute the
363 offset adjustment values separately for each cluster. (Bug#11860)
364
365 * image.c: Restore mistakenly removed inclusion of w32.h. Without
366 it, GCC doesn't see prototypes of w32_delayed_load, and complains
367 about implicit conversions from integer to pointer.
368
369 2012-09-01 Daniel Colascione <dancol@dancol.org>
370
371 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
372 system used too early.
373
374 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
375
376 Better seed support for (random).
377 * emacs.c (main): Call init_random.
378 * fns.c (Frandom): Set the seed from a string argument, if given.
379 Remove long-obsolete Gentzel cruft.
380 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
381 (init_random): New function.
382
383 2012-09-01 Daniel Colascione <dancol@dancol.org>
384
385 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
386 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
387 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
388 x_wm_set_size_hint, x_query_colors, x_real_positions,
389 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
390 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
391 all of which have been moved to common code.
392
393 * xfaces.c: Include TERM_HEADER instead of listing all possible
394 window-system headers.
395
396 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
397 to match header.
398
399 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
400 directly accessing frame internals.
401
402 * w32font.h: Include font.h. Define syms_of_w32font and
403 globals_of_w32font.
404
405 * process.c: Include TERM_HEADER instead of listing all possible
406 window-system headers.
407
408 * nsterm.h: Remove declarations now in frame.h. Define
409 FRAME_X_SCREEN, FRAME_X_VISUAL.
410
411 * menu.c: Include TERM_HEADER instead of listing all possible
412 window-system headers.
413
414 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
415 window system.
416
417 * keyboard.c: Include TERM_HEADER instead of listing all possible
418 window-system headers.
419
420 * image.c: Include TERM_HEADER instead of listing all possible
421 window-system headers. Declare Vlibrary_cache when compiling for
422 Windows.
423
424 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
425 window system declarations.
426
427 * frame.h: Move common functions here: set_frame_menubar,
428 x_set_window_size, x_sync, x_get_focus_frame,
429 x_set_mouse_position, x_set_mouse_pixel_position,
430 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
431 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
432 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
433 x_activate_menubar, x_real_positions, x_bitmap_icon,
434 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
435 and x_query_colors.
436
437 * frame.c: Include TERM_HEADER instead of listing all possible
438 window-system headers.
439
440 * font.c: Include TERM_HEADER instead of listing all possible
441 window-system headers.
442
443 * emacs.c: Include TERM_HEADER.
444
445 * dispnew.c: Include TERM_HEADER instead of listing all possible
446 window-system headers.
447
448 * ccl.h: Include character.h.
449
450 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
451 the current window system; include in list of objects to link into
452 Emacs.
453
454 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
455
456 Remove mark_ttys function and fix tty_display_info initialization.
457 * lisp.h (mark_ttys): Remove prototype.
458 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
459 to mark_ttys because all possible values of 'top_frame' slot are
460 the frames which are reachable from Vframe_list.
461 * term.c (mark_ttys): Remove.
462 (init_tty): Safely initialize 'top_frame' slot with Qnil.
463
464 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
465
466 Change struct frame bitfields from unsigned char to unsigned.
467 * frame.h (struct frame): Change type of 'display_preempted',
468 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
469 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
470 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
471 bitfields from unsigned char to unsigned.
472
473 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
474
475 Remove unused member of struct x_output and struct w32_output.
476 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
477 * w32term.h (struct w32_output): Likewise.
478
479 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
480
481 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
482 does not become zero (Bug#12234).
483
484 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
485
486 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
487 for GCC 4.7.1 x86-64.
488
489 2012-08-30 Glenn Morris <rgm@gnu.org>
490
491 * lread.c (init_lread): For out-of-tree builds, only add the
492 source directory's site-lisp dir to the load-path if it exists,
493 consistent with in-tree builds. (Bug#12302)
494
495 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
496
497 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
498 button_values to NULL. Call setStykeMask so dialogs get a close button.
499 (windowShouldClose:): Set window_closed.
500 (dealloc): New member, free button_values.
501 (process_dialog:): Make member function. Remove window argument,
502 replace window with self. Count buttons and allocate and store values
503 in button_values.
504 (addButton:value:row:): value is int with the name tag. Call setTag
505 with tag. Remove return self, declare return value as void.
506 (addString:row:): Remove return self, declare return value as void.
507 (addSplit): Remove return self, declare return value as void.
508 (clicked:): Remove return self, declare return value as void.
509 Set dialog_return to button_values[seltag]. Code formatting change.
510 (initFromContents:isQuestion:): Adjust call to process_dialog.
511 Code formatting change.
512 (timeout_handler:): Set timer_fired to YES.
513 (runDialogAt:): Set timer_fired to NO.
514 Handle click on close button as quit.
515
516 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
517 Add window_closed and button_values. Add void as return value for
518 add(Button|String|Split). addButton takes int instead of Lisp_Object.
519 Add process_dialog as new member.
520
521 2012-08-28 Eli Zaretskii <eliz@gnu.org>
522
523 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
524 is not one of the heaps we manage. (Bug#12242)
525
526 2012-08-28 Glenn Morris <rgm@gnu.org>
527
528 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
529
530 2012-08-28 Martin Rudalics <rudalics@gmx.at>
531
532 * window.c (Fset_window_configuration): Remove handling of
533 auto-buffer-name window parameter. Install revision of reverted
534 fix.
535
536 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
537
538 Do not allow to set major mode for a dead buffer.
539 * buffer.c (Fset_buffer_major_mode): Signal an error
540 if the buffer is dead.
541 (Fother_buffer, other_buffer_safely): Remove redundant
542 nested declaration.
543
544 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
545
546 Always use set_buffer_if_live to restore original buffer at unwind.
547 * buffer.h (record_unwind_current_buffer): New function.
548 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
549 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
550 * undo.c, window.c: Adjust users.
551 * buffer.c (set_buffer_if_live): Fix comment.
552
553 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
554
555 Fix usage of set_buffer_internal.
556 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
557 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
558 * coding.c (decode_coding): Omit redundant test.
559 * fileio.c (decide_coding_unwind): Likewise.
560 * fns.c (secure_hash): Likewise.
561 * insdel.c (modify_region): Likewise.
562 * keyboard.c (command_loop_1): Likewise.
563 * print.c (PRINTFINISH): Likewise.
564 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
565
566 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
567
568 * dispnew.c: Use bool for boolean.
569 (frame_garbaged, display_completed, delayed_size_change)
570 (fonts_changed_p, add_window_display_history)
571 (add_frame_display_history, verify_row_hash)
572 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
573 (row_equal_p, realloc_glyph_pool)
574 (allocate_matrices_for_frame_redisplay)
575 (showing_window_margins_p)
576 (adjust_frame_glyphs_for_frame_redisplay)
577 (build_frame_matrix_from_leaf_window, make_current)
578 (mirrored_line_dance, mirror_line_dance, update_frame)
579 (update_window_tree, update_single_window)
580 (check_current_matrix_flags, update_window, update_text_area)
581 (update_window_line, set_window_update_flags, scrolling_window)
582 (update_frame_1, scrolling, buffer_posn_from_coords)
583 (do_pending_window_change, change_frame_size)
584 (change_frame_size_1, sit_for):
585 Use bool for boolean.
586 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
587 and remove last int (actually boolean) argument, which was always 0.
588 All callers changed.
589 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
590 * dispextern.h (struct composition_it): Use bool for boolean.
591 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
592 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
593 * dired.c (file_name_completion):
594 Use bool for boolean. (This was missed in an earlier change.)
595
596 2012-08-27 Martin Rudalics <rudalics@gmx.at>
597
598 * window.c (Fset_window_configuration): Revert first part of
599 last change.
600
601 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
602
603 * nsterm.h (NSPanel): New class variable dialog_return.
604
605 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
606 dialog_return.
607 (windowShouldClose:): Use stop instead of stopModalWithCode.
608 (clicked:): Ditto, and also set dialog_return (Bug#12258).
609 (timeout_handler:): Use stop instead of abortModal. Send a dummy
610 event.
611 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
612 modal loop returns.
613
614 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
615
616 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
617 * composite.c (find_composition, composition_gstring_p)
618 (composition_reseat_it, find_automatic_composition):
619 * data.c (let_shadows_buffer_binding_p)
620 (let_shadows_global_binding_p, set_internal, make_blv)
621 (Fmake_variable_buffer_local, Fmake_local_variable)
622 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
623 (cons_to_signed, arith_driver):
624 * dbusbind.c (xd_in_read_queued_messages):
625 * dired.c (directory_files_internal, file_name_completion):
626 Use bool for booleans.
627 * dired.c (file_name_completion):
628 * process.h (fd_callback):
629 Omit int (actually boolean) argument. It wasn't being used.
630 All uses changed.
631 * composite.h, lisp.h: Reflect above API changes.
632
633 * cmds.c, coding.c: Use bool for booleans.
634 * cmds.c (move_point, Fself_insert_command):
635 * coding.h (struct composition status, struct coding_system):
636 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
637 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
638 (emacs_mule_char, decode_coding_emacs_mule)
639 (encode_coding_emacs_mule, detect_coding_iso_2022)
640 (decode_coding_iso_2022, encode_invocation_designation)
641 (encode_designation_at_bol, encode_coding_iso_2022)
642 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
643 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
644 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
645 (encode_coding_raw_text, detect_coding_charset)
646 (decode_coding_charset, encode_coding_charset, detect_eol)
647 (detect_coding, get_translation_table, produce_chars)
648 (consume_chars, reused_workbuf_in_use)
649 (make_conversion_work_buffer, code_conversion_save)
650 (decode_coding_object, encode_coding_object)
651 (detect_coding_system, char_encodable_p)
652 (Funencodable_char_position, code_convert_region)
653 (code_convert_string, code_convert_string_norecord)
654 (Fset_coding_system_priority):
655 * fileio.c (Finsert_file_contents):
656 Use bool for booleans.
657 * coding.h, lisp.h: Reflect above API changes.
658 * coding.c: Remove unnecessary static function decls.
659 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
660 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
661 not a boolean 'int', since callers never look at the return value.
662 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
663 * coding.h (decoding_buffer_size, encoding_buffer_size)
664 (emacs_mule_string_char): Remove unused extern decls.
665 (struct iso_2022_spec, struct coding_system):
666 Use 'unsigned int : 1' for boolean fields, since there's more than one.
667 (struct emacs_mule_spec): Remove unused field 'full_support'.
668 All initializations removed.
669 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
670
671 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
672
673 Fix spare memory change (Bug#12286).
674 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
675 (valid_lisp_object_p): Likewise.
676
677 2012-08-27 Martin Rudalics <rudalics@gmx.at>
678
679 * window.c (Fset_window_configuration): Record any window's old
680 buffer if it's replaced (see Bug#8789). If the new current
681 buffer doesn't appear in the selected window, go to its old
682 point (Bug#12208).
683
684 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
685
686 Special MEM_TYPE_SPARE to denote reserved memory.
687 * alloc.c (enum mem_type): New memory type.
688 (refill_memory_reserve): Use new type for spare memory.
689 This prevents live_cons_p and live_string_p from incorrect
690 detection of uninitialized objects from spare memory as live.
691
692 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
693
694 Spelling fixes.
695 * Makefile.in (.PHONY): versioclean -> versionclean.
696
697 Remove unused external symbols.
698 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
699 * window.c (Qwindow_valid_p, decode_valid_window):
700 Now static, not extern.
701 * data.c (Qinterval): Remove; unused.
702 (syms_of_data): Do not define 'interval'.
703 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
704 * window.h (decode_valid_window):
705 Remove decls.
706
707 * character.c, charset.c, chartab.c: Use bool for booleans.
708 * character.c (lisp_string_width, string_count_byte8)
709 (string_escape_byte8):
710 * charset.c (charset_map_loaded, load_charset_map, read_hex):
711 (load_charset_map_from_file, map_charset_chars)
712 (Fdefine_charset_internal, define_charset_internal)
713 (Fdeclare_equiv_charset, find_charsets_in_text)
714 (Ffind_charset_region, char_charset, Fiso_charset):
715 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
716 (sub_char_table_set, sub_char_table_set_range)
717 (char_table_set_range, optimize_sub_char_table)
718 (map_sub_char_table):
719 Use bool for boolean.
720 * character.c (str_to_unibyte): Omit last boolean argument; it was
721 always 0. All callers changed.
722 * character.h, charset.h: Adjust to match previous changes.
723 * character.h (char_printable_p): Remove decl of nonexistent function.
724 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
725 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
726 are all boolean, so make them single-bit bitfields.
727
728 * lisp.h (ASET): Remove attempt to detect side effects.
729 It was meant to be temporary and it often doesn't work,
730 because when IDX has side effects the behavior of IDX==IDX
731 is undefined. See Stefan Monnier in
732 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
733
734 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
735
736 * lisp.h (functionp): New function (extracted from Ffunctionp).
737 (FUNCTIONP): Use it.
738 * eval.c (Ffunctionp): Use it.
739
740 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
741
742 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
743 as that's faster and simpler than static storage. Don't bother
744 with the g_main_context_query overhead if g_main_context_pending
745 says no events are pending.
746 (gfds, gfds_size): Remove these static vars.
747 (xgselect_initialize): Remove; no longer needed.
748 All uses and decls removed.
749
750 * emacs.c (fatal_error_signal_hook): Remove.
751 All uses removed. This leftover from old code was always 0.
752
753 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
754 * casefiddle.c (casify_object, casify_region):
755 * casetab.c (set_case_table):
756 * category.c, category.h (word_boundary_p):
757 * category.h (CHAR_HAS_CATEGORY):
758 Use bool for booleans, instead of int.
759
760 2012-08-25 Eli Zaretskii <eliz@gnu.org>
761
762 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
763
764 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
765
766 On assertion failure, print backtrace if available.
767 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
768 (die) [ENABLE_CHECKING]: Print a backtrace if available.
769 * Makefile.in (LIB_EXECINFO): New macro.
770 (LIBES): Use it.
771
772 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
773 * bytecode.c (exec_byte_code):
774 * callint.c (check_mark, Fcall_interactively):
775 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
776 (getenv_internal, sync_process_alive, call_process_exited):
777 * lisp.h (USE_SAFE_ALLOCA):
778 Use bool for booleans, instead of int.
779 * lisp.h, process.h: Adjust prototypes to match above changes.
780 * callint.c (Fcall_interactively): Don't assume the mark's
781 offset fits in 'int'.
782
783 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
784
785 * buffer.c, buffer.h: Use bool for boolean.
786 * buffer.c (reset_buffer_local_variables)
787 (buffer_lisp_local_variables, Fset_buffer_modified_p)
788 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
789 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
790 (overlay_touches_p, overlay_strings, Foverlay_put)
791 (report_overlay_modification, call_overlay_mod_hooks):
792 (mmap_enlarge, mmap_set_vars):
793 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
794 Use bool for booleans, instead of int.
795 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
796 since the 1-or-0 return value is always ignored anyway.
797 (mmap_initialized_p):
798 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
799 * buffer.h, lisp.h: Adjust prototypes to match above changes.
800
801 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
802
803 * bidi.c: Use bool for boolean.
804 This is a bit more readable, and makes the text segment of bidi.o
805 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
806 Presumably it's faster too.
807 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
808 Now bool.
809 (bidi_cache_find_level_change, bidi_cache_iterator_state)
810 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
811 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
812 (bidi_explicit_dir_char, bidi_level_of_next_char)
813 (bidi_find_other_level_edge, bidi_move_to_visually_next):
814 Use bool for booleans, instead of int.
815 * dispextern.h (bidi_init_it, bidi_paragraph_init)
816 (bidi_unshelve_cache): Adjust decls to match code.
817
818 2012-08-23 Martin Rudalics <rudalics@gmx.at>
819
820 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
821 argument.
822
823 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
824
825 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
826 * atimer.h: Include <stdbool.h>.
827
828 2012-08-22 Dan Nicolaescu <dann@gnu.org>
829
830 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
831 compile time tests instead of run time tests on systems that do
832 not use them.
833 (FRAME_MAC_P): Remove leftover from deleted code.
834 * frame.c (syms_of_frame): Remove leftover from deleted code.
835
836 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
837
838 * nsterm.m (insertText:): Don't clear modifiers if code is space.
839
840 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
841
842 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
843 Otherwise, the compiler complains about (A?B:C) where B is void
844 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
845 (fontset_add): Return void, for FONTSET_ADD.
846
847 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
848
849 * alloc.c: Use bool for booleans.
850 (gc_in_progress, abort_on_gc)
851 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
852 (dont_register_blocks) [GC_MALLOC_CHECK]:
853 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
854 (check_string_bytes, make_specified_string, memory_full)
855 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
856 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
857 (mark_stack, valid_pointer_p, make_pure_string)
858 (Fgarbage_collect, survives_gc_p, gc_sweep):
859 Use bool for booleans, instead of int.
860 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
861 Remove unused local.
862 * alloc.c (PURE_POINTER_P):
863 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
864 * editfns.c (Fformat):
865 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
866 (Fdo_auto_save):
867 * fns.c (sweep_weak_table):
868 * lisp.h (suppress_checking, push_message, survives_gc_p)
869 (make_pure_string, gc_in_progress, abort_on_gc):
870 * lread.c (readchar, read1):
871 * print.c (Fprin1_to_string):
872 * xdisp.c (push_message):
873 Use bool for booleans affected directly or indirectly by
874 alloc.c's changes.
875
876 Make recently-introduced setters macros.
877 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
878 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
879 (set_fontset_default, set_fontset_fallback): Rename from their
880 upper-case counterparts, and make them functions rather than macros.
881 This is more consistent with the other recently-introduced setters.
882 These don't need to be inline, since they're local.
883
884 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
885
886 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
887 the loop (Bug#12247).
888
889 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
890
891 * lisp.h (vcopy): Use memcpy rather than our own loop.
892 This fixes a performance regression introduced by the recent
893 addition of vcopy. This means 'vcopy' will need to be modified
894 for a copying collector, but that's OK. Also, tighten the
895 checking in the assertion.
896
897 2012-08-21 Eli Zaretskii <eliz@gnu.org>
898
899 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
900 components for RTL text (Bug#11860). Adjust X-OFFSET of each
901 non-base glyph for the width of the base character, according to
902 what x_draw_composite_glyph_string_foreground expects.
903 Generate WADJUST value according to composition_gstring_width's
904 expectations, to produce correct width of the composed character.
905 Reverse the sign of the DU offset produced by ScriptPlace.
906
907 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
908
909 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
910
911 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
912
913 Avoid direct writes to contents member of struct Lisp_Vector.
914 * lisp.h (vcopy): New function to copy data into vector.
915 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
916 * fns.c (Ffillarray): Use ASET.
917 * keyboard.c (timer_check_2): Use AREF and ASET.
918 (append_tool_bar_item, Frecent_keys): Use vcopy.
919 * lread.c (read_vector): Use ASET.
920 * msdos.c (Frecent_doskeys): Use vcopy.
921 * xface.c (Finternal_copy_lisp_face): Use vcopy.
922 (Finternal_merge_in_global_face): Use ASET and vcopy.
923 * xfont.c (xfont_list_pattern): Likewise.
924
925 2012-08-21 Martin Rudalics <rudalics@gmx.at>
926
927 * window.c (Fwindow_point): For the selected window always return
928 the position of its buffer's point.
929 (Fset_window_point): For the selected window always go in its
930 buffer to the specified position.
931
932 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
933
934 Setter macros for fontsets.
935 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
936 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
937 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
938 Adjust users.
939
940 2012-08-20 Glenn Morris <rgm@gnu.org>
941
942 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
943 Don't assume that `ln -f' works.
944
945 2012-08-20 Eli Zaretskii <eliz@gnu.org>
946
947 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
948 and later about non-assignments with no effect. See discussion at
949 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
950 details.
951
952 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
953
954 Inline setter functions for Lisp_Objects slots of struct specbinding.
955 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
956 Adjust users.
957
958 2012-08-20 Martin Rudalics <rudalics@gmx.at>
959
960 * window.c (select_window): Always make selected window's buffer
961 current.
962
963 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
964
965 Use AREF and ASET for docstrings of category tables.
966 * category.h (CATEGORY_DOCSTRING): Use AREF.
967 (SET_CATEGORY_DOCSTRING): Use ASET.
968 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
969
970 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
971
972 Inline setter functions for hash table members.
973 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
974 (set_hash_hash, set_hash_index): Rename with _slot suffix.
975 (set_hash_key_and_value, set_hash_index, set_hash_next)
976 (set_hash_hash): New functions.
977 * charset.c, fns.c: Adjust users.
978
979 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
980
981 Inline getter and setter functions for per-buffer values.
982 * buffer.h (per_buffer_default, set_per_buffer_default)
983 (per_buffer_value, set_per_buffer_value): New functions.
984 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
985 * buffer.c, data.c: Adjust users.
986
987 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
988
989 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
990
991 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
992
993 Rely on <config.h> + <unistd.h> to declare 'environ',
994 as gnulib does this if the system doesn't.
995 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
996 Remove declaration. MS-Windows declares it on stdlib.h which is
997 included by conf_post.h.
998 * emacs.c (environ) [DOUG_LEA_MALLOC]:
999 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1000 * vm-limit.c: Include <unistd.h>, for 'environ'.
1001
1002 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1003 (start_of_data): Remove decl; mem-limits.h provides it.
1004
1005 * xdisp.c (handle_invisible_prop): Make it a bit faster
1006 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1007
1008 2012-08-19 Chong Yidong <cyd@gnu.org>
1009
1010 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1011 ends (Bug#3874).
1012
1013 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1014
1015 * .gdbinit: Use call instead of set when calling a function in the
1016 inferior.
1017
1018 * data.c (set_internal): Don't use set_blv_found.
1019 (Fkill_local_variable): Likewise.
1020
1021 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1022
1023 * nsfont.m (ns_ascii_average_width): Ensure the string
1024 ascii_printable is initialized with a null-terminated character
1025 array. Otherwise, it can contain undesired extra characters.
1026
1027 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1028
1029 port new setting code to Sun C 5.8 2005/10/13
1030 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1031 Return void, not Lisp_Object. Otherwise, the compiler
1032 complains about (A?B:C) where B is void and C is Lisp_Object
1033 when compiling CHAR_TABLE_SET, due to the recent change to
1034 the API of sub_char_table_set_contents.
1035
1036 2012-08-18 Chong Yidong <cyd@gnu.org>
1037
1038 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1039 for the string case (Bug#3874).
1040
1041 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1042
1043 * buffer.h (BSET): Remove (Bug#12215).
1044 Replace all uses with calls to new setter functions.
1045 (bset_bidi_paragraph_direction, bset_case_canon_table)
1046 (bset_case_eqv_table, bset_directory, bset_display_count)
1047 (bset_display_time, bset_downcase_table)
1048 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1049 (bset_last_selected_window, bset_local_var_alist)
1050 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1051 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1052 (bset_width_table):
1053 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1054 (bset_auto_fill_function, bset_auto_save_file_format)
1055 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1056 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1057 (bset_cache_long_line_scans, bset_case_fold_search)
1058 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1059 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1060 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1061 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1062 (bset_header_line_format, bset_indicate_buffer_boundaries)
1063 (bset_indicate_empty_lines, bset_invisibility_spec)
1064 (bset_left_fringe_width, bset_major_mode, bset_mark)
1065 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1066 (bset_name, bset_overwrite_mode, bset_pt_marker)
1067 (bset_right_fringe_width, bset_save_length)
1068 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1069 (bset_scroll_up_aggressively, bset_selective_display)
1070 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1071 (bset_word_wrap, bset_zv_marker):
1072 * category.c (bset_category_table):
1073 * syntax.c (bset_syntax_table):
1074 New setter functions.
1075
1076 * process.h (PSET): Remove (Bug#12215).
1077 Replace all uses with calls to new setter functions.
1078 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1079 (PROCESS_INLINE): New macro.
1080 (pset_childp): New setter function.
1081 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1082 * process.c (PROCESS_INLINE):
1083 Define to EXTERN_INLINE, so that the corresponding functions
1084 are compiled into code.
1085 (pset_buffer, pset_command, pset_decode_coding_system)
1086 (pset_decoding_buf, pset_encode_coding_system)
1087 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1088 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1089 (pset_type, pset_write_queue): New setter functions.
1090
1091 * window.h (WSET): Remove (Bug#12215).
1092 Replace all uses with calls to new setter functions.
1093 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1094 (WINDOW_INLINE): New macro.
1095 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1096 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1097 (wset_total_lines, wset_vertical_scroll_bar)
1098 (wset_window_end_pos, wset_window_end_valid)
1099 (wset_window_end_vpos): New setter functions.
1100 * window.c (WINDOW_INLINE):
1101 Define to EXTERN_INLINE, so that the corresponding functions
1102 are compiled into code.
1103 (wset_combination_limit, wset_dedicated, wset_display_table)
1104 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1105 (wset_new_normal, wset_new_total, wset_next_buffers)
1106 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1107 (wset_prev_buffers, wset_right_fringe_width)
1108 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1109 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1110 (wset_window_parameters):
1111 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1112 (wset_column_number_displayed, wset_region_showing):
1113 New setter functions.
1114
1115 * termhooks.h (TSET): Remove (Bug#12215).
1116 Replace all uses with calls to new setter functions.
1117 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1118 (TERMHOOKS_INLINE): New macro.
1119 (tset_charset_list, tset_selection_alist): New setter functions.
1120 * terminal.c (TERMHOOKS_INLINE):
1121 Define to EXTERN_INLINE, so that the corresponding functions
1122 are compiled into code.
1123 (tset_param_alist): New setter function.
1124
1125 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1126
1127 * keyboard.h (KSET): Remove (Bug#12215).
1128 Replace all uses with calls to new setter functions.
1129 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1130 (KEYBOARD_INLINE): New macro.
1131 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1132 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1133 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1134 New setter functions.
1135 * keyboard.c (KEYBOARD_INLINE):
1136 Define to EXTERN_INLINE, so that the corresponding functions
1137 are compiled into code.
1138 (kset_echo_string, kset_kbd_queue)
1139 (kset_keyboard_translate_table, kset_last_prefix_arg)
1140 (kset_last_repeatable_command, kset_local_function_key_map)
1141 (kset_overriding_terminal_local_map, kset_real_last_command)
1142 (kset_system_key_syms): New setter functions.
1143
1144 * frame.h (FSET): Remove (Bug#12215).
1145 Replace all uses with calls to new setter functions.
1146 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1147 (FRAME_INLINE): New macro.
1148 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1149 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1150 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1151 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1152 (fset_param_alist, fset_root_window, fset_scroll_bars)
1153 (fset_selected_window, fset_title, fset_tool_bar_items)
1154 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1155 * frame.c (FRAME_INLINE):
1156 Define to EXTERN_INLINE, so that the corresponding functions
1157 are compiled into code.
1158 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1159
1160 A few more naming-convention fixes for getters and setters.
1161 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1162 and rename from buffer_overlays_set_before.
1163 (set_buffer_overlays_after): Move here from buffer.h, and rename
1164 from buffer_overlays_set_after.
1165 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1166 All uses changed.
1167 (set_buffer_intervals): Rename from buffer_set_intervals.
1168 * intervals.c (set_interval_object): Move here from intervals.h,
1169 and rename from interval_set_object.
1170 (set_interval_left): Move here from intervals.h, and rename from
1171 interval_set_left.
1172 (set_interval_right): Move here from intervals.h, and rename from
1173 interval_set_right.
1174 (copy_interval_parent): Move here from intervals.h, and rename from
1175 interval_copy_parent.
1176 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1177 (set_interval_plist): Rename from interval_set_plist.
1178 Return void, not Lisp_Object, since no caller uses the result.
1179 * lisp.h (string_intervals): Rename from string_get_intervals.
1180 (set_string_intervals): Rename from string_set_intervals.
1181
1182 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1183 (set_char_table_contents): Rename from char_table_set_contents.
1184 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1185 All uses changed. See the end of
1186 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1187
1188 * lisp.h (CSET): Remove (Bug#12215).
1189 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1190 (set_char_table_purpose): New functions,
1191 replacing CSET. All uses changed. For example, replace
1192 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1193 "set_char_table_parent (char_table, parent);".
1194 The old version was confusing because it used the same name
1195 'parent' for two different things.
1196
1197 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1198
1199 Functions to get and set Lisp_Object fields of buffer-local variables.
1200 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1201 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1202 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1203 * data.c, eval.c, frame.c: Adjust users.
1204
1205 2012-08-17 Chong Yidong <cyd@gnu.org>
1206
1207 * xfaces.c (merge_face_vectors): If the target font specfies a
1208 font spec, make the font's attributes take precedence over
1209 directly-specified attributes.
1210 (merge_face_ref): Recognize :font.
1211
1212 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1213
1214 Do not use memcpy for copying intervals.
1215 * intervals.c (reproduce_interval): New function.
1216 (reproduce_tree, reproduce_tree_obj): Use it.
1217 (reproduce_tree_obj): Remove prototype.
1218
1219 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1220
1221 * lisp.h (duration_to_sec_usec): Remove unused decl.
1222
1223 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1224
1225 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1226 to an allocated instance of NSString, not to the class itself.
1227
1228 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1229
1230 * makefile.w32-in (C_CTYPE_H): New macro.
1231 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1232 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1233 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1234
1235 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1236
1237 Use ASCII tests for character types.
1238 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1239 * xfns.c, xterm.c:
1240 Don't include <ctype.h>; was not needed.
1241 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1242 * sysdep.c, xfaces.c:
1243 Include <c-ctype.h> instead of <ctype.h>.
1244 * nsterm.m: Include <c-ctype.h>.
1245 * charset.c (read_hex):
1246 * doc.c (Fsnarf_documentation):
1247 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1248 (DRIVE_LETTER) [DOS_NT]:
1249 (Ffile_name_directory, Fexpand_file_name)
1250 (Fsubstitute_in_file_name):
1251 * font.c (font_parse_xlfd, font_parse_fcname):
1252 * frame.c (x_set_font_backend):
1253 * gtkutil.c (xg_get_font):
1254 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1255 * nsimage.m (hexchar):
1256 * nsterm.m (ns_xlfd_to_fontname):
1257 * sysdep.c (system_process_attributes):
1258 * xfaces.c (hash_string_case_insensitive):
1259 Use C-locale tests instead of locale-specific tests for character
1260 types, since we want the ASCII interpretation here, not the
1261 interpretation suitable for whatever happens to be the current locale.
1262
1263 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1264
1265 Consistently check windows for validity/liveness
1266 (Bug#11984, Bug#12025, Bug#12026).
1267 * lisp.h (CHECK_VALID_WINDOW): New macro.
1268 * window.c (decode_window): Rename to decode_live_window.
1269 (decode_valid_window, Fwindow_valid_p): New functions.
1270 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1271 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1272 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1273 (Fwindow_prev_sibling, Fwindow_combination_limit)
1274 (Fset_window_combination_limit, Fwindow_use_time)
1275 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1276 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1277 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1278 (Fwindow_hscroll, Fset_window_hscroll)
1279 (Fwindow_redisplay_end_trigger)
1280 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1281 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1282 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1283 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1284 (Fwindow_end, Fset_window_point, Fset_window_start)
1285 (Fpos_visible_in_window_p, Fwindow_line_height)
1286 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1287 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1288 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1289 (Fset_window_parameter, Fwindow_display_table)
1290 (Fset_window_display_table, Fdelete_other_windows_internal)
1291 (Fset_window_buffer, Fset_window_new_total)
1292 (Fset_window_new_normal, Fdelete_window_internal)
1293 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1294 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1295 (Fwindow_scroll_bars): Check whether argument window is a valid or
1296 live window. Update doc-strings.
1297 (syms_of_window): New symbol Qwindow_valid_p.
1298 * keyboard.c (Fposn_at_x_y): Check whether argument
1299 frame_or_window denotes a valid window.
1300
1301 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1302
1303 Fix previous char table change.
1304 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1305 * chartab.c (optimize_sub_char_table): Likewise.
1306
1307 2012-08-16 Chong Yidong <cyd@gnu.org>
1308
1309 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1310
1311 * xfont.c (xfont_open):
1312 * xftfont.c (xftfont_open): Set the font's max_width field.
1313
1314 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1315 min_width to space_width and average_width to the average over
1316 printable ASCII characters.
1317 (ns_char_width): Code cleanup.
1318 (ns_ascii_average_width): New utility function.
1319
1320 * font.h (struct font): Update comments.
1321
1322 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1323
1324 Simple interface to set Lisp_Object fields of character tables.
1325 * lisp.h (CSET): New macro.
1326 (char_table_set_extras, char_table_set_contents)
1327 (sub_char_table_set_contents): New function.
1328 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1329 * syntax.c: Adjust users.
1330
1331 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1332
1333 * eval.c (eval_sub): Bind lexical-binding.
1334 * lread.c (Qlexical_binding): Make non-static.
1335
1336 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1337
1338 * nsmenu.m (popupSession): Remove.
1339 (pop_down_menu): Remove endModalSession.
1340 (timeout_handler:): New method.
1341 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1342 Call runModalForWindow. Check timer_fired when it returns.
1343 If not set, cancel timer and break out of loop.
1344 Otherwise loop again, with a new timeout.
1345
1346 * nsterm.m: Include fcntl.h if present.
1347 (fd_entry, t_readfds, inNsSelect): Remove.
1348 (select_writefds, select_valid, select_timeout, selfds)
1349 (select_mutex, apploopnr): Add.
1350 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1351 Otherwise call kbd_buffer_store_event.
1352 (ns_send_appdefined): Remove release of fd_entry.
1353 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1354 Increment and decrement apploopnr.
1355 (ns_select): If no file descriptors, just do a NSTimer.
1356 Otherwise copy read/write masks and start select thread (fd_handler).
1357 Start main loop and wait for application defined event.
1358 Inform select thread to stop selecting after main loop is exited.
1359 (ns_term_init): Create selfds pipe and set non-blocking.
1360 Initialize select_mutex. Start the select thread (fd_handler).
1361 (fd_handler:): Loop forever, wait for info from the main thread
1362 to either start or stop selecting. When select returns, send
1363 and appdefined event.
1364 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1365 If not call kbd_buffer_store_event.
1366
1367 * nsterm.h (EmacsApp): fd_handler takes id argument.
1368 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1369
1370 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1371
1372 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1373
1374 * region-cache.c (move_cache_gap): Update gap_len using the actual
1375 growth of the boundaries array. Do not change cache_len.
1376 (Bug#12196)
1377
1378 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1379
1380 Generalize and cleanup font subsystem checks.
1381 * font.h (FONT_DEBUG, font_assert): Remove.
1382 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1383 Change font_assert to eassert. Use eassert where appropriate.
1384
1385 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1386
1387 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1388
1389 2012-08-15 Chong Yidong <cyd@gnu.org>
1390
1391 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1392 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1393 extract the font descriptor instead of just the font name.
1394 In that case, return a font spec instead of a string.
1395 (x_last_font_name): Move to this file from xfns.c.
1396
1397 * xfns.c (Fx_select_font): The return value can also be a font
1398 spec. Move x_last_font_name management to gtkutil.c.
1399
1400 * xfaces.c: Make font weight and style symbols non-static.
1401
1402 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1403
1404 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1405 (bug#12117).
1406
1407 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1408
1409 * alloc.c (Fgarbage_collect): Use plural form consistently.
1410
1411 2012-08-14 Eli Zaretskii <eliz@gnu.org>
1412
1413 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1414 iteration through the command loop. Fixes a problem whereby mouse
1415 movements are ignored until the first mouse click.
1416
1417 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1418
1419 Use bool, not int, for Lisp booleans.
1420 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1421 makes Emacs a bit smaller and presumably a bit faster.
1422 * lisp.h: Include <stdbool.h>.
1423 (struct Lisp_Boolfwd, defvar_bool):
1424 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1425 * regex.c [!emacs]: Include <stdbool.h>.
1426 (false, true): Remove; <stdbool.h> does this for us now.
1427
1428 2012-08-14 Chong Yidong <cyd@gnu.org>
1429
1430 * character.c (Fcharacterp): Doc fix (Bug#12076).
1431
1432 * data.c (Findirect_variable): Doc fix (Bug#11040).
1433
1434 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1435
1436 * editfns.c (Fformat): Doc fix (Bug#12059).
1437 (Fsave_current_buffer): Doc fix (Bug#11542).
1438
1439 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1440
1441 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1442 (bug#12022).
1443
1444 2012-08-14 Martin Rudalics <rudalics@gmx.at>
1445
1446 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1447 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1448 * minibuf.c (choose_minibuf_frame, read_minibuf):
1449 * w32fns.c (x_create_tip_frame):
1450 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1451 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1452
1453 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1454
1455 * intervals.c (offset_intervals): Remove obsolete comment.
1456
1457 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1458
1459 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1460
1461 2012-08-14 Gergely Risko <gergely@risko.hu>
1462
1463 * coding.c (decode_coding): Record buffer modification before
1464 disabling undo_list (Bug#11773).
1465
1466 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1467
1468 Revert and cleanup some recent overlay changes.
1469 * buffer.h (enum overlay_type): Remove.
1470 (buffer_get_overlays, buffer_set_overlays): Likewise.
1471 (buffer_set_overlays_before, buffer_set_overlays_after):
1472 New function. Adjust users.
1473 (unchain_both): Add eassert.
1474
1475 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1476
1477 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1478
1479 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1480
1481 * gtkutil.c (xg_mark_data): Don't assume C99.
1482
1483 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1484
1485 * gtkutil.c (xg_frame_tb_info): New struct.
1486 (TB_INFO_KEY): New define.
1487 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1488 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1489 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1490 if not present.
1491 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1492 is up to date. Otherwise store new data.
1493 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1494
1495 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1496
1497 Use KSET for write access to Lisp_Object members of struct kboard.
1498 * keyboard.h (KSET): New macro.
1499 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1500 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1501 * xterm.c: Adjust users.
1502
1503 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1504
1505 Use BSET for write access to Lisp_Object members of struct buffer.
1506 * buffer.h (BSET): New macro.
1507 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1508 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1509 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1510 * window.c, xdisp.c, xfns.c: Adjust users.
1511
1512 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1513
1514 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1515
1516 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1517
1518 * nsterm.m (not_in_argv): New function.
1519 (application:openFile, application:openTempFile:):
1520 (application:openFileWithoutUI:, application:openFiles:): Open file
1521 if not_in_argv returns non-zero (bug#12171).
1522
1523 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
1524 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1525 Define for Gtk+ versions less than 3.2.
1526 (xg_get_font_name): Use those functions/macros here.
1527 Reported by Frans Oilinki <moilinki@gmail.com>.
1528
1529 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1530
1531 * unexmacosx.c (copy_data_segment): Copy initialized data in
1532 statically linked libraries from input file rather than memory.
1533
1534 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1535 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1536 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1537
1538 2012-08-10 Glenn Morris <rgm@gnu.org>
1539
1540 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1541 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1542
1543 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1544
1545 Fix last change to allow compilation with low optimization levels.
1546 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1547 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1548
1549 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1550
1551 Use common inline syntax in intervals.h.
1552 * intervals.h (INTERVALS_INLINE): New macro.
1553 Change all users from LISP_INLINE.
1554
1555 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1556
1557 Define Qnone once for all platforms.
1558 * frame.c (Qnone): Define here.
1559 (syms_of_frame): DEFSYM it.
1560 * lisp.h (Qnone): New declaration.
1561 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1562 * xfns.c: Remove duplication. Adjust users.
1563
1564 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1565
1566 Remove unused macros from intervals.h.
1567 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1568 * intervals.c: Adjust comment.
1569
1570 2012-08-10 Eli Zaretskii <eliz@gnu.org>
1571
1572 * w32fns.c <w32_unicode_gui>: New static variable.
1573 (globals_of_w32fns): Initialize it according to os_subtype.
1574 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1575 testing os_subtype.
1576
1577 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
1578 Eli Zaretskii <eliz@gnu.org>
1579
1580 Fix bug #10299 with Unicode characters sent by customized
1581 keyboards created by MSKLC.
1582 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1583 (w32_init_class): Use it to initialize the Emacs class with either
1584 ANSI or Unicode API calls.
1585 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1586 later.
1587 (w32_wnd_proc): If the character code sent by WM_CHAR or
1588 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1589 original message. Call DefWindowProcW on NT and later.
1590
1591 2012-08-10 Glenn Morris <rgm@gnu.org>
1592
1593 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1594
1595 * lisp.h (DIRECTORY_SEP): Let configure set it.
1596
1597 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1598
1599 Use TSET for write access to Lisp_Object slots of struct terminal.
1600 * termhooks.h (TSET): New macro.
1601 * coding.c, terminal.c, xselect.c: Adjust users.
1602
1603 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1604
1605 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1606 the failing expression, include them in the error message.
1607 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1608 * lisp.h (internal_condition_case_n): Update declaration.
1609
1610 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1611
1612 Inline functions to examine and change buffer overlays.
1613 * buffer.c (unchain_both): New function.
1614 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1615 (buffer_has_overlays): New function.
1616 (enum overlay_type): New enum.
1617 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1618 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1619
1620 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1621
1622 Inline functions to examine and change buffer intervals.
1623 * alloc.c (mark_interval_tree): Remove.
1624 (MARK_INTERVAL_TREE): Simplify.
1625 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1626 * intervals.c (buffer_balance_intervals): New function.
1627 (graft_intervals_into_buffer): Adjust indentation.
1628 (set_intervals_multibyte): Simplify.
1629 * buffer.h (BUF_INTERVALS): Remove.
1630 (buffer_get_intervals, buffer_set_intervals): New function.
1631 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1632 * intervals.c, textprop.c: Adjust users.
1633
1634 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1635
1636 Inline functions to examine and change string intervals.
1637 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1638 (string_get_intervals, string_set_intervals): New function.
1639 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1640 * lread.c, print.c, textprop.c: Adjust users.
1641
1642 2012-08-08 Glenn Morris <rgm@gnu.org>
1643
1644 * lisp.mk (lisp): Remove language/persian.elc.
1645
1646 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1647
1648 Cleanup intervals.
1649 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1650 (NULL_INTERVAL_P): Likewise. Adjust users.
1651 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1652 Adjust comment. Move under #if 0.
1653 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1654 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1655
1656 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1657
1658 Check total length of intervals with eassert.
1659 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1660 * intervals.c: Change all users to eassert.
1661
1662 2012-08-07 Eli Zaretskii <eliz@gnu.org>
1663
1664 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1665 Rename fields to match removal of FGET and WGET and disuse of
1666 INTERNAL_FIELD in Lisp_Cons.
1667
1668 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1669
1670 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1671 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1672 name since all xname users are fixed long time ago. Do not
1673 use INTERNAL_FIELD.
1674 (set_symbol_name, set_symbol_function, set_symbol_plist):
1675 (set_symbol_next, set_overlay_plist): New function.
1676 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1677 (struct Lisp_Overlay): Likewise.
1678 (CVAR, MVAR, SVAR): Remove.
1679 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1680 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1681 * xterm.c: Adjust users.
1682 * .gdbinit: Change to use name field of struct Lisp_Symbol
1683 where appropriate.
1684
1685 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1686
1687 Basic functions to set Lisp_Object and pointer slots of intervals.
1688 * intervals.h (interval_set_parent, interval_set_object):
1689 (interval_set_left, interval_set_right, interval_set_plist):
1690 (interval_copy_parent): New function.
1691 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
1692 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1693 Adjust indentation.
1694 (INTERVAL_SIZE): Remove. Adjust users.
1695 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1696
1697 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1698
1699 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1700 * process.h (PGET): Remove.
1701 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1702 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1703
1704 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1705
1706 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1707 * window.h (WGET): Remove.
1708 (struct window): Do not use INTERNAL_FIELD.
1709 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1710 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1711 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1712 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1713 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1714 Adjust users.
1715
1716 2012-08-07 Chong Yidong <cyd@gnu.org>
1717
1718 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1719 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1720 (Fdelete_window_internal): Signal an error if the window is not on
1721 a live frame (Bug#12025).
1722
1723 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1724
1725 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1726 * frame.h (FGET): Remove.
1727 (struct frame): Do not use INTERNAL_FIELD.
1728 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1729 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1730 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1731 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1732
1733 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
1734
1735 * w32.c: Silence compiler warnings.
1736 (map_w32_filename): Remove unused variable `is_fat'.
1737 (chase_symlinks): Add parentheses around expression.
1738
1739 2012-08-06 Glenn Morris <rgm@gnu.org>
1740
1741 * sysdep.c: Respect BROKEN_GETWD.
1742
1743 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1744 Let configure handle it.
1745 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1746
1747 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1748
1749 Use GCALIGNMENT where appropriate.
1750 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1751 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1752 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1753
1754 2012-08-06 Eli Zaretskii <eliz@gnu.org>
1755
1756 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1757 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
1758
1759 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1760
1761 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1762 that should be sufficient for everyone.
1763
1764 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1765
1766 * keyboard.c (timer_check_2): Add break so timer_check returns next
1767 timeout.
1768
1769 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1770
1771 Fix Windows build errors introduced after converting to WGET and WSET.
1772 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1773 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1774
1775 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1776
1777 * nsterm.m (ns_frame_rehighlight): Use FSET.
1778
1779 * nsmenu.m (ns_update_menubar): Use FSET.
1780
1781 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1782
1783 Separate read and write access to Lisp_Object slots of Lisp_Process.
1784 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1785 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1786
1787 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1788
1789 Separate read and write access to Lisp_Object slots of struct window.
1790 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1791 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1792 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1793 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1794 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1795 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1796 Adjust users.
1797
1798 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1799
1800 Fix Windows build errors introduced after converting to FGET and FSET.
1801 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1802 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1803 (w32_judge_scroll_bars): Change to use FSET.
1804 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1805
1806 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1807
1808 Fix replacement typo.
1809 * window.c (replace_window): Set root_window instead of
1810 selected_window. This fixes a total window subsystem
1811 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1812
1813 2012-08-06 Glenn Morris <rgm@gnu.org>
1814
1815 * lisp.mk (lisp): Add language/persian.elc.
1816
1817 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1818
1819 Separate read and write access to Lisp_Object slots of struct frame.
1820 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1821 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1822 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1823 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1824 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1825
1826 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1827
1828 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1829
1830 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1831
1832 Generalize common compile-time constants.
1833 * lisp.h (header_size, bool_header_size, word_size): Now here.
1834 (struct Lisp_Vector): Add comment.
1835 (struct Lisp_Bool_Vector): Move up to define handy constants.
1836 (VECSIZE, PSEUDOVECSIZE): Simplify.
1837 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1838 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1839 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1840 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1841 * xfont.c, xmenu.c: Use word_size where appropriate.
1842
1843 2012-08-05 Lawrence Mitchell <wence@gmx.li>
1844
1845 * search.c (Freplace_match): Treat \? in the replacement text
1846 literally (Bug#8161).
1847
1848 2012-08-05 Chong Yidong <cyd@gnu.org>
1849
1850 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1851 * frame.c (Vdelete_frame_functions):
1852 * emacs.c (Vkill_emacs_hook): Doc fix.
1853
1854 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1855
1856 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1857 --with-x-toolkit=no builds.
1858 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1859
1860 2012-08-04 Chong Yidong <cyd@gnu.org>
1861
1862 * syntax.c (Fmodify_syntax_entry): Doc fix.
1863
1864 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1865
1866 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1867 * w32.c (init_environment): Change the default values of many
1868 environment variables in dflt_envvars[] to NULL, to avoid pushing
1869 them into environment when they were not already defined.
1870 Remove the code that deletes site-lisp subdirectories from the default
1871 value of EMACSLOADPATH, as it is no longer needed.
1872 (check_windows_init_file): Now external, not static.
1873 Use Vload_path as is, without adding anything, as this function is now
1874 called when Vload_path is already set up.
1875
1876 * w32.h (check_windows_init_file): Add prototype.
1877
1878 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1879 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1880 compatibility with Posix platforms.
1881 (main): Move the call to check_windows_init_file to here from
1882 w32.c.
1883 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1884 any, in the DEFALT argument into the root of the Emacs build or
1885 installation tree, as appropriate.
1886
1887 * callproc.c (init_callproc_1): Call decode_env_path instead of
1888 doing its equivalent by hand.
1889 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1890 the code that sets Vexec_path run on MS-Windows.
1891
1892 * lread.c (init_lread): Add comments to #ifdef's.
1893
1894 * msdos.c (dos_set_window_size, IT_update_begin)
1895 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1896 instead of direct references.
1897
1898 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1899
1900 Export DEFAULT_REHASH_* to GDB.
1901 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1902 Now constants, not macros.
1903
1904 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1905
1906 Remove unnecessary casts involving pointers.
1907 These casts are no longer needed now that we assume C89 or later,
1908 since they involve casting to or from void *.
1909 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1910 (make_pure_float, make_pure_vector):
1911 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1912 * macros.c (Fstart_kbd_macro):
1913 * menu.c (find_and_return_menu_selection):
1914 * minibuf.c (read_minibuf_noninteractive):
1915 * sysdep.c (closedir):
1916 * xdisp.c (x_produce_glyphs):
1917 * xfaces.c (compare_fonts_by_sort_order):
1918 * xfns.c (x_real_positions, select_visual):
1919 * xselect.c (x_stop_queuing_selection_requests)
1920 (x_get_window_property, x_get_window_property_as_lisp_data):
1921 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1922 Remove unnecessary pointer casts.
1923 * alloc.c (record_xmalloc): New function.
1924 * lisp.h (record_xmalloc): New decl.
1925 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1926 more like a function. This is because the pointer cast is not
1927 needed. All uses changed.
1928 * print.c (print_string, print_error_message): Avoid length recalc.
1929
1930 Improve fix for macroexp crash with debugging (Bug#12118).
1931 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1932 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1933 not supposed to be invoked from the garbage collector.
1934 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1935 (gc_aset): New function, which is like ASET but can be
1936 used in the garbage collector.
1937 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1938 (set_hash_index): Use it instead of ASET.
1939
1940 2012-08-03 Eli Zaretskii <eliz@gnu.org>
1941
1942 Support symlinks on latest versions of MS-Windows.
1943 * w32.c: Include winioctl.h and aclapi.h.
1944 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1945 (revert_to_self): Forward declarations of static functions.
1946 <static BOOL g_b_init_get_security_info>:
1947 <g_b_init_create_symbolic_link>: New static flags.
1948 (globals_of_w32): Initialize them to zero.
1949 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1950 (map_w32_filename): Improve commentary. Simplify switch.
1951 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1952 headers (most versions of MinGW w32api don't).
1953 (get_security_info, create_symbolic_link)
1954 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1955 New functions.
1956 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1957 in the argument file name.
1958 (sys_access): Call unc_volume_file_attributes only if
1959 GetFileAttributes fails with network-related error codes.
1960 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1961 have the required privileges.
1962 (get_file_security_desc_by_name): Rename from
1963 get_file_security_desc.
1964 (stat_worker): New function, with most of the guts of 'stat', and
1965 with addition of handling of symlinks and support for 'lstat'.
1966 If possible, get file's attributes and security information by
1967 handle, not by name. Produce S_IFLNK bit for symlinks, when
1968 called from 'lstat'.
1969 (stat, lstat): New functions, call 'stat_worker'.
1970 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1971 symlinks when the underlying filesystem supports them.
1972
1973 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1974
1975 Fix macroexp crash on Windows with debugging (Bug#12118).
1976 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1977 checking subscripts; problem introduced with the recent
1978 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1979 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1980 since it's used in non-static inline functions now.
1981
1982 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1983 Don't assume buffer size fits in 'int'. Remove unused local.
1984
1985 Use C99-style 'extern inline' if available.
1986 * buffer.h (BUFFER_INLINE):
1987 * category.h (CATEGORY_INLINE):
1988 * character.h (CHARACTER_INLINE):
1989 * charset.h (CHARSET_INLINE):
1990 * composite.h (COMPOSITE_INLINE):
1991 * dispextern.h (DISPEXTERN_INLINE):
1992 * lisp.h (LISP_INLINE):
1993 * systime.h (SYSTIME_INLINE):
1994 New macro, replacing 'static inline' in this header.
1995 * buffer.h, category.h, character.h, charset.h, composite.h:
1996 * dispextern.h, lisp.h, systime.h:
1997 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1998 * alloc.c (LISP_INLINE):
1999 * buffer.c (BUFFER_INLINE):
2000 * category.c (CATEGORY_INLINE):
2001 * character.c (CHARACTER_INLINE):
2002 * charset.c (CHARSET_INLINE):
2003 * composite.c (COMPOSITE_INLINE):
2004 * dispnew.c (DISPEXTERN_INLINE):
2005 * sysdep.c (SYSTIME_INLINE):
2006 Define to EXTERN_INLINE, so that the corresponding functions
2007 are compiled into code.
2008 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2009 (INLINE_HEADER_END): New macros.
2010 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2011 since it's used in non-static inline functions now.
2012 (VALMASK) [!USE_LSB_TAG]: Likewise.
2013
2014 2012-08-02 Glenn Morris <rgm@gnu.org>
2015
2016 * s/: Remove empty directory.
2017
2018 * s/ms-w32.h: Move to ../nt/inc.
2019 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2020 Update for new ms-w32.h location.
2021
2022 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2023
2024 Port to Solaris 8.
2025 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2026
2027 2012-08-02 Glenn Morris <rgm@gnu.org>
2028
2029 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2030 hard-coding the path separator.
2031
2032 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2033
2034 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2035 This how ASET and AREF are supposed to work, and makes
2036 it easier to think about future improvements. See
2037 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2038 * charset.h (set_charset_attr): New function.
2039 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2040 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2041 (aref_addr): New function. All uses of &AREF(...) changed.
2042 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2043 (set_hash_index): New functions. All lvalue-style uses of
2044 HASH_KEY etc. changed.
2045 * keyboard.c (set_prop): New function. All lvalue-style uses
2046 of PROP changed.
2047
2048 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2049
2050 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2051 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2052 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2053 * nsfns.m (ns_set_name_as_filename): Likewise.
2054 * nsmenu.m (ns_update_menubar): Likewise.
2055 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2056
2057 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2058
2059 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2060 Adapt to latest changes in field names of the corresponding Lisp
2061 objects.
2062
2063 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2064
2065 2012-08-01 Glenn Morris <rgm@gnu.org>
2066
2067 * s/msdos.h: Remove file.
2068 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2069 * Makefile.in (S_FILE): Remove.
2070 (config_h): Remove S_FILE.
2071
2072 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2073
2074 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2075 Remove; moved to nt/config.nt.
2076
2077 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2078
2079 Use INTERNAL_FIELD for conses and overlays.
2080 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2081 Remove obsolete comment.
2082 (MVAR): New macro.
2083 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2084 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2085
2086 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2087
2088 Use INTERNAL_FIELD for symbols.
2089 * lisp.h (SVAR): New macro. Adjust users.
2090 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2091 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2092
2093 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2094
2095 Use INTERNAL_FIELD for processes.
2096 * process.h (PVAR): New macro. Adjust style.
2097 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2098 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2099
2100 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2101
2102 Use INTERNAL_FIELD for windows.
2103 * window.h (WVAR): New macro.
2104 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2105 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2106 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2107 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2108 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2109 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2110
2111 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2112
2113 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2114
2115 2012-08-01 Glenn Morris <rgm@gnu.org>
2116
2117 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2118 Move to configure.ac.
2119
2120 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2121
2122 * makefile.w32-in (CONFIG_H): Update dependencies.
2123 (CONF_POST_H): New macro.
2124
2125 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2126
2127 2012-07-31 Glenn Morris <rgm@gnu.org>
2128
2129 * Makefile.in (S_FILE): No longer set by configure.
2130
2131 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2132 is available.
2133 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2134
2135 * process.h (NULL_DEVICE):
2136 * emacs.c (SEPCHAR):
2137 * editfns.c (USER_FULL_NAME): Let configure set them.
2138
2139 * s/README, s/template.h: Remove files.
2140
2141 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2142
2143 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2144 Move to configure.ac.
2145
2146 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2147
2148 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2149 resulting renaming of 'struct frame' members.
2150
2151 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2152
2153 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2154 after introduction of FVAR.
2155
2156 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2157
2158 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2159
2160 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2161 instead of compositeToPoint.
2162 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2163
2164 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2165
2166 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2167
2168 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2169 * lisp.h (INTERNAL_FIELD): New macro.
2170 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2171 (BVAR): Change to use INTERNAL_FIELD.
2172 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2173 (KVAR): Change to use INTERNAL_FIELD.
2174 * frame.h (FVAR): New macro.
2175 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2176 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2177 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2178 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2179 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2180
2181 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2182
2183 Miscellaneous fixes for non-default X toolkits.
2184 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2185 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2186 Move under #ifdef USE_LUCID.
2187 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2188 definition and usage to avoid warnings.
2189
2190 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2191
2192 * nsterm.m (openFiles): Fix previous checkin.
2193
2194 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2195
2196 * indent.c (compute_motion): Remove unused local.
2197
2198 2012-07-31 Glenn Morris <rgm@gnu.org>
2199
2200 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2201
2202 * conf_post.h [USG5_4]:
2203 Move remaining contents of s/usg5-4-common.h here.
2204 * s/usg5-4-common.h: Remove file.
2205
2206 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2207 * s/irix6-5.h: Remove file.
2208
2209 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2210 * s/darwin.h: Remove file.
2211
2212 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2213 * s/hpux10-20.h: Remove file, which is now empty.
2214
2215 2012-07-30 Glenn Morris <rgm@gnu.org>
2216
2217 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2218 * Makefile.in (config_h): Add conf_post.h.
2219 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2220
2221 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2222
2223 * nsterm.m (ns_do_open_file): New variable.
2224 (ns_term_init): Set ns_do_open_file to YES after run returns.
2225 (openFile, openTempFile, openFileWithoutUI, openFiles):
2226 Open files only if ns_do_open_file.
2227
2228 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2229
2230 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2231 This no-op macro hasn't been needed for many years.
2232 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2233
2234 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2235 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2236 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2237 gdb_make_enums_visible.
2238 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2239 (DIRECTORY_SEP): Now a constant, not a macro.
2240
2241 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2242
2243 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2244 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2245
2246 * w32term.c <w32_keyboard_codepage>: Renamed from
2247 keyboard_codepage and now external. All users changed.
2248
2249 * w32term.h: Add declaration of w32_keyboard_codepage.
2250
2251 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2252 the codepage to translate keys to Unicode. If this argument is
2253 -1, use the value returned by GetConsoleCP. All callers changed.
2254
2255 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2256
2257 Update .PHONY listings in makefiles.
2258 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2259 bootstrap-clean, distclean, maintainer-clean, versioclean,
2260 extraclean, frc.
2261
2262 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2263 This is a bit clearer. Fix some commentary typos.
2264
2265 2012-07-30 Glenn Morris <rgm@gnu.org>
2266
2267 * s/netbsd.h: Let configure include signal.h if needed.
2268 Remove file, which is now empty.
2269
2270 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2271 Let configure set them.
2272 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2273 No more need to undefine.
2274
2275 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2276
2277 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2278 non-single-byte char when adding meta modifier. (Bug#12090)
2279
2280 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2281
2282 Convert safe_call to use variable number of arguments.
2283 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2284 (safe_call2): Fix comment.
2285 * lisp.h (safe_call): Adjust prototype.
2286 * coding.c (encode_coding_object): Change to use safe_call2.
2287 * xfaces.c (merge_face_heights): Change to use safe_call1.
2288
2289 2012-07-30 Glenn Morris <rgm@gnu.org>
2290
2291 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2292 does that unconditionally. Remove file, which is now empty.
2293
2294 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2295 Remove empty files.
2296
2297 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2298
2299 Export to GDB most of lisp.h's remaining object-like macros.
2300 * lisp.h (min, max): Move earlier, because they're used earlier now.
2301 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2302 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2303 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2304 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2305 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2306 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2307 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2308 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2309 Now constants, for GDB. They need not be macros.
2310 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2311 Now constants, for GDB, as well as macros, for static initializers.
2312 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2313 Move to after the definition of struct Lisp_Char_Table,
2314 since the former now needs that type defined.
2315 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2316 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2317 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2318 New enums, for gdb_make_enums_visible.
2319 (GLYPH_MODE_LINE_FACE): Remove; unused.
2320 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2321 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2322 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2323 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2324 enum maxargs, enum MAX_ALLOCA.
2325 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2326 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2327 no longer needed, now that they are done in lisp.h.
2328
2329 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2330
2331 Cleanup string bytes checking.
2332 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2333 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2334 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2335 (check_sblock, compact_small_strings): Simplify.
2336
2337 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2338
2339 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2340 These macros are confusing and no longer need to be defined, as
2341 the enum values now suffice. All uses replaced with definiens.
2342 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2343
2344 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2345
2346 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2347 ($(BLD)/w32console.$(O)): Update dependencies.
2348
2349 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2350
2351 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2352 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2353 time. Adjust users.
2354 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2355
2356 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2357
2358 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2359 setting sitelisp (Bug#12010).
2360
2361 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2362
2363 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2364
2365 * w32heap.c (cache_system_info):
2366 * w32.c (sys_rename):
2367 * w32proc.c (find_child_console, sys_kill): All users changed.
2368
2369 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2370
2371 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2372
2373 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2374
2375 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2376
2377 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2378
2379 Cleanup statistics calculation in Fgarbage_collect.
2380 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2381 Fix zombies percentage calculation. Simplify elapsed time calculation.
2382
2383 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2384
2385 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2386 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2387 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2388 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2389 (replace_range, replace_range_2, del_range_2): Change to eassert.
2390 * marker.c (byte_char_debug_check): Adjust style.
2391
2392 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2393
2394 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2395 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2396 long-ago-commented-out code that talks about "WIN32".
2397 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2398 All uses changed.
2399
2400 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2401
2402 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2403 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2404 Simplify by using alignof.
2405 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2406 * lisp.h: Include <stdalign.h>.
2407 (GCALIGNMENT): New macro and constant.
2408 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2409 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2410 (stdalign): New macro, if not already defined.
2411
2412 2012-07-28 Eli Zaretskii <eliz@gnu.org>
2413
2414 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2415 * w32inevt.c: Include w32inevt.h.
2416 (w32_read_console_input): New inline function, calls either
2417 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2418 w32_console_unicode_input.
2419 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2420 (w32_kbd_patch_key, key_event): Use the codepage returned by
2421 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2422 (key_event): use uChar.UnicodeChar only if
2423 w32_console_unicode_input is non-zero.
2424
2425 * w32console.c: Include w32heap.h.
2426 <w32_console_unicode_input>: New global variable.
2427 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2428 family of Windows, zero otherwise.
2429
2430 * w32inevt.h: Declare w32_console_unicode_input.
2431
2432 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2433 --without-x. (Bug#11742)
2434
2435 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2436
2437 Adjust GDB to reflect pvec_type changes (Bug#12036).
2438 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2439 2012-07-04 changes to pseudovector representation.
2440 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
2441
2442 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
2443
2444 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2445 bus address.
2446 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2447
2448 2012-07-27 Eli Zaretskii <eliz@gnu.org>
2449
2450 * alloc.c (listn): Fix the order the arguments are consed onto the
2451 list.
2452
2453 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2454 enumeration constants, as PURE and HEAP are too general, and clash
2455 with other headers and sources, such as gmalloc.c and the
2456 MS-Windows system headers. All users changed.
2457
2458 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2459
2460 Revert last save_excursion_save and save_excursion_restore changes.
2461 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2462 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2463
2464 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2465
2466 Fix recently-introduced typos in Windows port.
2467 Reported by Martin Rudalics <rudalics@gmx.at>.
2468 * w32.c (init_environment): Replace comma with semicolon.
2469 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
2470
2471 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2472
2473 Improve GDB symbol export (Bug#12036).
2474 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2475 arms of an 'if', not using conditional expressions; otherwise GDB
2476 complains about the types in the unevaluated arm when the argument
2477 is an integer literal.
2478 (xgetint): Simplify expression.
2479 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2480 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2481 Zaretskii in <http://bugs.gnu.org/12036#13>.
2482 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2483 needed now that we have gdb_make_enums_visible.
2484 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2485 (enum enum_USE_LSB_TAG):
2486 New enum types, packaging up enums that need to be exported to GDB.
2487
2488 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2489
2490 Utility function to make a list from specified amount of objects.
2491 * lisp.h (enum constype): New datatype.
2492 (listn): New prototype.
2493 * alloc.c (listn): New function.
2494 (Fmemory_use_count, syms_of_alloc): Use it.
2495 * buffer.c (syms_of_buffer): Likewise.
2496 * callint.c (syms_of_callint): Likewise.
2497 * charset.c (define_charset_internal): Likewise.
2498 * coding.c (syms_of_coding): Likewise.
2499 * keymap.c (syms_of_keymap): Likewise.
2500 * search.c (syms_of_search): Likewise.
2501 * syntax.c (syms_of_syntax): Likewise.
2502 * w32.c (init_environment): Likewise.
2503 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2504 * xdisp.c (syms_of_xdisp): Likewise.
2505 * xfns.c (syms_of_xfns): Likewise.
2506
2507 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2508
2509 Fast save_excursion_save and save_excursion_restore.
2510 * lisp.h (struct Lisp_Excursion): New data type.
2511 (PVEC_EXCURSION): New pseudovector type.
2512 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2513 to deal with it. Adjust comments.
2514 (init_marker, attach_marker): New prototype.
2515 (unchain_marker): Adjust prototype.
2516 * marker.c (attach_marker): Change to global.
2517 (init_marker): New function.
2518 * alloc.c (Fmake_marker, build_marker): Use it.
2519 (build_marker): More easserts.
2520 (mark_object): Handle struct Lisp_Excursion.
2521 * editfns.c (save_excursion_save, save_excursion_restore):
2522 Reimplement to use struct Lisp_Excursion. Add comments.
2523
2524 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 Fix export of symbols to GDB (Bug#12036).
2527 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2528 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2529 emacs.c, as this is a more-suitable home. Had this been done earlier
2530 the fix for 12036 would have avoided some of the problems noted in
2531 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2532 would have been more obvious.
2533 * emacs.c: Do not include <verify.h>; no longer needed.
2534 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
2535 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2536 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2537 Remove; now done in lisp.h.
2538 * lisp.h (PUBLISH_TO_GDB): New macro.
2539 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2540 (DATA_SEG_BITS): Use it.
2541 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2542 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2543 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2544 not be usable in #if. This simplifies things.
2545
2546 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
2547
2548 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2549
2550 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2551
2552 Simplify export of symbols to GDB (Bug#12036).
2553 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2554 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2555 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2556 Adjust to changes in lisp.h and emacs.c, by using
2557 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2558 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2559 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2560 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2561 instead of gdb_valbits.
2562 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2563 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2564 instead of gdb_array_mark_flag.
2565 (xboolvector): Get size from $->size, not $->header.size.
2566 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2567 (xreload, hook-run, hookpost-run): Remove.
2568 * emacs.c: Include <verify.h>.
2569 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2570 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2571 Remove.
2572 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2573 (gdb_USE_LSB_TAG): New enum constants.
2574 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2575 Also define these as enum constants, so they're visible to GDB.
2576 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2577 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2578 as constants, so they're visible to GDB.
2579 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2580 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2581 Now enum constants, not macros, so they're visible to GDB.
2582 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2583 more convenient now. All uses changed.
2584 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2585 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2586
2587 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2588
2589 Explicitly free restriction data that are not needed anymore.
2590 * editfns.c (save_restriction_restore): Free restriction data.
2591
2592 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2593
2594 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2595 add argument, tune behavior, and adjust all callers.
2596
2597 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2598
2599 Use typedef for EMACS_INT, EMACS_UINT.
2600 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2601 than macros. This simplifies debugging in the usual case, since
2602 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2603 and it allows expressions involving EMACS_INT casts.
2604 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2605
2606 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2607
2608 * nsterm.m (ns_read_socket): Return early if there is a modal
2609 window (Bug#12043).
2610
2611 2012-07-25 Martin Rudalics <rudalics@gmx.at>
2612
2613 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2614 that FOCUS-FRAME can be omitted.
2615
2616 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2617
2618 Adjust buffer text indirection counters at the end of Fkill_buffer.
2619 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2620 buffer is definitely dead. This should really fix an issue reported
2621 by Christoph Scholtes again. (Bug#12007).
2622 (init_buffer_once): Initialize indirection counters of
2623 buffer_defaults and buffer_local_symbols (for sanity and safety).
2624
2625 2012-07-24 Eli Zaretskii <eliz@gnu.org>
2626
2627 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2628 and continuation glyphs on tooltip frames, leave them at zero.
2629 Avoids continued lines in tooltips. (Bug#11832)
2630
2631 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2632
2633 Simplify copy_overlay.
2634 * buffer.c (copy_overlay): Simplify. Use build_marker.
2635 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2636
2637 2012-07-23 Eli Zaretskii <eliz@gnu.org>
2638
2639 * print.c (print_object): Don't crash when a frame's name is nil
2640 or invalid. (Bug#12025)
2641
2642 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2643 it signals an error when a tooltip frame is being created.
2644
2645 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2646
2647 Cleanup miscellaneous objects allocation and initialization.
2648 * alloc.c (allocate_misc): Change to static. Add argument to
2649 specify the subtype. Adjust comment and users.
2650 (build_overlay): New function.
2651 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2652 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2653 (allocate_misc): Remove prototype.
2654 (build_overlay): Add prototype.
2655
2656 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2657
2658 Swap buffer text indirection counters in Fbuffer_swap_text.
2659 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2660 This avoids crash reported by Christoph Scholtes at
2661 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2662
2663 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2664
2665 * nsmenu.m (Popdown_data): New struct.
2666 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2667 free Popdown_data.
2668 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2669 (initWithContentRect): Make imgView and contentView non-static
2670 and autorelease them. Also autorelease img and matrix (Bug#12005).
2671 (dealloc): Remove (Bug#12005).
2672
2673 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2674
2675 Adjust consing_since_gc when objects are explicitly freed.
2676 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2677 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2678 (free_cons, free_misc): Subtract object size from consing_since_gc.
2679
2680 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2681
2682 Simplify and cleanup markers positioning code.
2683 * marker.c (attach_marker): More useful eassert.
2684 (live_buffer, set_marker_internal): New function.
2685 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2686 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2687
2688 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2689
2690 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2691 as it's limited by the amount of memory, not by INT_MAX.
2692
2693 2012-07-21 Eli Zaretskii <eliz@gnu.org>
2694
2695 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2696 in special-event-map. See the discussion at
2697 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2698 for the reasons.
2699
2700 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2701 info.dwItemData. Fixes crashes on 64-bit Windows.
2702 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2703
2704 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2705
2706 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
2707 (conversationIdentifier): Return value is NSInteger.
2708 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
2709
2710 2012-07-21 Chong Yidong <cyd@gnu.org>
2711
2712 * window.c (decode_any_window): Signal an error if the window is
2713 on a dead frame (Bug#11984).
2714
2715 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2716
2717 Add indirection counting to speed up Fkill_buffer.
2718 * buffer.h (struct buffer): New member.
2719 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2720 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2721 base buffer indirection counter.
2722 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2723 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2724 through buffer list if indirection counter is 0.
2725
2726 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2727
2728 Extend the value returned by Fgarbage_collect with heap statistics.
2729 * alloc.c (Qheap): New symbol.
2730 (syms_of_alloc): DEFSYM it.
2731 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2732 (Fmemory_free): Remove.
2733 (syms_of_alloc): Don't defsubr it.
2734 * buffer.c (Fcompact_buffer): Remove.
2735 (syms_of_buffer): Don't defsubr it.
2736
2737 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2738
2739 Make maybe_gc inline.
2740 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2741 * lisp.h (consing_since_gc, gc_relative_threshold)
2742 (memory_full_cons_threshold): Revert declaration.
2743 (maybe_gc): Remove prototype, define as inline.
2744 * alloc.c: Remove old commented-out code.
2745 (consing_since_gc, gc_relative_threshold)
2746 (memory_full_cons_threshold): Revert to global.
2747 (maybe_gc): Remove.
2748
2749 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2750
2751 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2752 * lisp.h (build_unibyte_string): New function.
2753 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2754 * sysdep.c, w32fns.c, xfns.c: Use it.
2755 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2756 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2757 Adjust users accordingly.
2758 * font.h (font_open_by_name): Adjust prototype.
2759
2760 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2761
2762 Cleanup calls to Fgarbage_collect.
2763 * lisp.h (maybe_gc): New prototype.
2764 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2765 Remove declarations.
2766 * alloc.c (maybe_gc): New function.
2767 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2768 Make them static.
2769 * bytecode.c (MAYBE_GC): Use maybe_gc.
2770 * eval.c (eval_sub, Ffuncall): Likewise.
2771 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2772 to avoid dependency from auto-save feature.
2773
2774 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2775
2776 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2777 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2778 'for_each_per_buffer_object_at'.
2779 All uses changed. It's better to use upper-case for macros that
2780 cannot be implemented as functions, to give the reader a clue
2781 that they're special.
2782
2783 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2784
2785 * alloc.c (Fgarbage_collect): Tweak docstring.
2786
2787 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2788
2789 Tweak the value returned from Fgarbage_collect again.
2790 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2791 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2792 Adjust documentation.
2793 (total_vector_bytes): Rename to total_vector_slots, adjust
2794 accounting.
2795 (total_free_vector_bytes): Rename to total_free_vector_slots,
2796 adjust accounting.
2797 (Qstring_bytes, Qvector_slots): New symbols.
2798 (syms_of_alloc): DEFSYM them.
2799
2800 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2801
2802 Buffer compaction primitive which may be used from Lisp.
2803 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2804 (syms_of_buffer): Register Fcompact_buffer.
2805 * alloc.c (Fgarbage_collect): Use compact_buffer.
2806 * buffer.h (compact_buffer): New prototype.
2807 (struct buffer_text): New member.
2808
2809 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2810
2811 New macro to iterate over all buffers, miscellaneous cleanups.
2812 * lisp.h (all_buffers): Remove declaration.
2813 * buffer.h (all_buffers): Add declaration, with comment.
2814 (for_each_buffer): New macro.
2815 * alloc.c (Fgarbage_collect, mark_object): Use it.
2816 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2817 (init_buffer): Likewise.
2818 * data.c (Fset_default): Likewise.
2819 * coding.c (code_conversion_restore): Remove redundant check
2820 for dead buffer.
2821 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2822
2823 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2824
2825 Fix bug that created negative-length intervals.
2826 * intervals.c (merge_interval_right, merge_interval_left):
2827 Do not zero out this interval if it is absorbed by its children,
2828 as this interval's total length doesn't change in that case. See
2829 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2830
2831 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2832
2833 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2834 when invoking (make-bool-vector N t) and N is a positive
2835 multiple of 8 -- the last 8 bits were mistakenly cleared.
2836
2837 Remove some struct layout assumptions in bool vectors.
2838 * alloc.c (bool_header_size): New constant.
2839 (header_size, word_size): Move earlier, as they're now used earlier.
2840 Use 'word_size' in a few more places, where it's appropriate.
2841 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2842 padding before the data member of a bool vector.
2843 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2844 than doing the check by hand with an abort ().
2845
2846 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2847
2848 * eval.c (Fdefvar): Don't check constants since we only set the var if
2849 it's not yet defined anyway (bug#11904).
2850
2851 * lisp.h (last_undo_boundary): Declare new var.
2852 * keyboard.c (command_loop_1): Set it.
2853 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2854 were auto-added by the command loop (bug#11774).
2855
2856 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2857
2858 * w32font.c (Qsymbol): Remove local definition.
2859 (syms_of_w32font): Don't DEFSYM it.
2860
2861 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2862
2863 Fix sweep_vectors to handle large bool vectors correctly.
2864 * alloc.c (sweep_vectors): Account total_vector_bytes for
2865 bool vectors larger than VBLOCK_BYTES_MAX.
2866
2867 2012-07-18 Chong Yidong <cyd@gnu.org>
2868
2869 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2870 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2871
2872 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2873
2874 Return more descriptive data from Fgarbage_collect.
2875 Suggested by Stefan Monnier in
2876 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2877 * alloc.c (bounded_number): New function.
2878 (total_buffers, total_vectors): New variable.
2879 (total_string_size): Rename to total_string_bytes, adjust users.
2880 (total_vector_size): Rename to total_vector_bytes, adjust users.
2881 (sweep_vectors): Account total_vectors and total_vector_bytes.
2882 (Fgarbage_collect): New return value. Adjust documentation.
2883 (gc_sweep): Account total_buffers.
2884 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2885 (VECTOR_SIZE): Remove.
2886 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2887 (Qinterval, Qmisc): New symbols.
2888 (syms_of_data): Initialize them.
2889 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2890 (Qcons, Qbuffer): New declarations.
2891
2892 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2893
2894 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2895 Round up, not down. Improve doc.
2896
2897 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2898
2899 Restore old code in allocate_string_data to avoid Faset breakage.
2900 Reported by Julien Danjou <julien@danjou.info> in
2901 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2902 * alloc.c (allocate_string_data): Restore old code with minor
2903 adjustments, fix comment to explain this subtle issue.
2904
2905 2012-07-17 Eli Zaretskii <eliz@gnu.org>
2906
2907 Remove FILE_SYSTEM_CASE.
2908 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2909
2910 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2911 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2912 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2913 call-process-region passes it through expand-file-name.
2914
2915 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2916
2917 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2918
2919 Fix crash when creating indirect buffer (Bug#11917)
2920 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2921 Don't handle unbound variables specially if non-zero.
2922 (Fbuffer_local_variables): Pass zero.
2923 (clone_per_buffer_values): Pass non-zero.
2924
2925 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2926
2927 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2928 to make the loop interruptible.
2929
2930 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2931
2932 * gnutls.c (emacs_gnutls_handshake): Only retry if
2933 GNUTLS_E_INTERRUPTED.
2934
2935 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2936
2937 Cleanup and convert miscellaneous checks to eassert.
2938 * alloc.c (mark_interval): Fix comment, partially rephrase
2939 old comment from intervals.h (see below).
2940 * intervals.c (find_interval, adjust_intervals_for_insertion)
2941 (delete_interval, adjust_intervals_for_deletion)
2942 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2943 Convert to eassert.
2944 (adjust_intervals_for_insertion, make_new_interval):
2945 Remove obsolete and unused code.
2946 * intervals.h (struct interval): Remove obsolete comment.
2947 * textprotp.c (erase_properties): Remove unused code.
2948 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2949 (Fremove_list_of_text_properties): Convert to eassert.
2950
2951 2012-07-17 Chong Yidong <cyd@gnu.org>
2952
2953 * editfns.c (Finsert_char): Doc fix.
2954
2955 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2956
2957 Fix previous change to make Fmemory_free always accurate.
2958 * alloc.c (make_interval): Update total_free_intervals.
2959 (make_float): Likewise for total_free_floats.
2960 (free_cons, Fcons): Likewise for total_free_conses.
2961 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2962 Likewise for total_free_vector_bytes.
2963 (Fmake_symbol): Likewise for total_free_symbols.
2964 (bytes_free): Remove.
2965
2966 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2967
2968 Simple free memory accounting feature.
2969 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2970 (sweep_vectors): Accumulate size of free vectors.
2971 (Fgarbage_collect): Setup bytes_free.
2972 (Fmemory_free): New function.
2973 (syms_of_alloc): Register it.
2974
2975 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2976
2977 Cleanup overlays checking.
2978 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2979 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2980 eassert and OVERLAYP.
2981 (sort_overlays): Change to use OVERLAYP.
2982
2983 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2984
2985 * editfns.c (Finsert_char): Make it interactive, and make the
2986 second arg optional. Copy interactive spec and docstring from
2987 ucs-insert.
2988
2989 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2990
2991 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2992 Unlike the other wrapped functions, fabs has an unspecified
2993 effect on errno.
2994
2995 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2996
2997 * nsterm.m (keyDown): Interpret flags without left/right bits
2998 as the left key (Bug#11670).
2999
3000 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3001
3002 Remove empty and useless init functions.
3003 * lisp.h (init_character_once, init_fns, init_image)
3004 (init_filelock, init_sound): Remove prototype.
3005 * character.c (init_character_once): Remove.
3006 * filelock.c (init_filelock): Likewise.
3007 * fns.c (init_fns): Likewise.
3008 * image.c (init_image): Likewise.
3009 * sound.c (init_sound): Likewise.
3010 * emacs.c (main): Adjust accordingly.
3011
3012 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3013
3014 * gtkutil.h: Tiny cleanups.
3015 (use_old_gtk_file_dialog): Remove useless declaration.
3016 (xg_uses_old_file_dialog): Add suggested const attribute.
3017
3018 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3019
3020 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3021 (bidi_paragraph_init): Use it to limit search forward for a strong
3022 directional character in abnormally large paragraphs full of
3023 neutral or weak characters. (Bug#11943)
3024
3025 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3026
3027 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3028 the toolbar (Bug#9451).
3029 (xg_make_tool_item): Give the widget event box a transparent
3030 background.
3031
3032 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3033
3034 Cleanup basic allocation variables and functions.
3035 * alloc.c (ignore_warnings, init_intervals, init_float)
3036 (init_cons, init_symbol, init_marker): Remove.
3037 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3038 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3039 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3040 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3041 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3042 (staticidx, init_alloc_once, init_strings, free_ablock):
3043 Remove redundant initialization.
3044 * fns.c (init_weak_hash_tables): Remove.
3045 * lisp.h (init_weak_hash_tables): Remove prototype.
3046
3047 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3048
3049 Use zero_vector where appropriate.
3050 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3051 accordingly.
3052 * lisp.h (zero_vector): New declaration.
3053 * font.c (null_vector): Remove.
3054 (syms_of_font): Remove initialization and staticpro.
3055 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3056 * keymap.c (Faccessible_keymaps): Likewise.
3057
3058 2012-07-15 Leo Liu <sdl.web@gmail.com>
3059
3060 * fringe.c: Fix typo in comments.
3061
3062 2012-07-14 Leo Liu <sdl.web@gmail.com>
3063
3064 * fringe.c: Add a new bitmap exclamation-mark.
3065
3066 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3067
3068 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3069
3070 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3071 (HAVE_MENUS): Don't define, defined by editing config.in with
3072 msdos/sed2v2.inp.
3073 (GMALLOC_INHIBIT_VALLOC): Don't define.
3074 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3075
3076 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3077
3078 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3079
3080 2012-07-14 Glenn Morris <rgm@gnu.org>
3081
3082 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3083 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3084 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3085
3086 2012-07-13 Glenn Morris <rgm@gnu.org>
3087
3088 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3089
3090 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3091 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3092
3093 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3094
3095 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3096 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3097 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3098 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3099 where appropriate.
3100 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3101 as boolean expression.
3102 (x_set_window_size): Remove unused variable toolbar.
3103 (ns_get_color_default, ns_mod_to_lisp): Remove.
3104 (ns_mouse_position): Remove unused variables xchar and ychar.
3105 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3106 (ns_set_vertical_scroll_bar): Remove unused variable count.
3107 (ns_delete_terminal): Remove unused variable i.
3108 (ns_term_init): Remove unused variables r, g and b.
3109 (mouseDown): Remove unused variable window.
3110 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3111 (initFrameFromEmacs): Remove unused variable vbextra.
3112 (mouseEntered): Remove unused variables p and dpyinfo.
3113 (mouseExited): Remove unused variables p and r.
3114 (ns_define_frame_cursor, ns_clear_frame_area)
3115 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3116 (menuDown): Assign [sender tag] to variable and cast the variable.
3117
3118 * nsterm.h (menuDown): Add id as type to argument sender.
3119 (ns_display_info_for_name): Add Lisp_Object argument.
3120 (ns_term_init): Add Lisp_Object argument.
3121 (ns_map_event_to_object): Add void argument.
3122 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3123 prototype with arguments and only declare if __OBJC__.
3124 (nxatoms_of_nsselect): Add void argument.
3125 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3126 (ns_alloc_autorelease_pool): Add void argument.
3127 (ns_release_autorelease_pool): Add void* argument.
3128 (ns_get_defaults_value): Add const char* argument.
3129
3130 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3131 (initFromContents): Use SSDATA where appropriate.
3132 (ns_update_menubar): Add braces to ambigous if-else.
3133 (initWithTitle): Put () around assignment in if statement.
3134 (ns_menu_show): Remove unused variables window and keymap.
3135 (update_frame_tool_bar): Remove unused variable selected_p.
3136 (initWithContentRect): Remove unused variable this_cmd_name.
3137
3138 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3139 appropriate.
3140 (setXBMColor): Remove unused variable len.
3141 (setPixmapData): Put () around assignment in loop statement.
3142
3143 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3144 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3145 where appropriate.
3146 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3147 around assignment in loop statement.
3148 (nsfont_open): Remove unused variable i.
3149 (nsfont_open): Remove unused variable len.
3150 (nsfont_draw): Remove unused variable cs.
3151
3152 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3153 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3154 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3155 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3156 (Fns_font_name, Fns_perform_service)
3157 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3158 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3159 (ns_set_name): Remove unused variable view.
3160 (x_set_menu_bar_lines): Remove unused variable olines.
3161 (x_set_tool_bar_lines): Remove unused variable root_window.
3162 (Fns_list_colors): Put () around assignment in while statement.
3163 (Fns_perform_service): Remove unused variable len.
3164 (Fns_display_usable_bounds): Remove unused variable top.
3165 (syms_of_nsfns): Remove unused variable i.
3166
3167 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3168 memcpy (Bug#11907).
3169
3170 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3171
3172 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3173 and free it with DestroyExceptionInfo (Bug#11558).
3174
3175 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3176
3177 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3178 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3179 Set here, not in nt/config.nt.
3180
3181 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3182
3183 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3184 cursor overflow into the last glyph on display line when the right
3185 fringe is off. (Bug#11832)
3186
3187 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3188
3189 * xdisp.c (produce_special_glyphs): Now static.
3190 * dispextern.h (produce_special_glyphs): Remove decl.
3191
3192 2012-07-13 Glenn Morris <rgm@gnu.org>
3193
3194 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3195 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3196
3197 * s/usg5-4-common.h (USG, USG5):
3198 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3199 * s/sol2-6.h (SOLARIS2):
3200 * s/irix6-5.h (IRIX6_5):
3201 * s/hpux10-20.h (USG, USG5, HPUX):
3202 * s/gnu-linux.h (USG, GNU_LINUX):
3203 * s/freebsd.h (BSD_SYSTEM):
3204 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3205 * s/cygwin.h (CYGWIN):
3206 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3207 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3208
3209 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3210
3211 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3212
3213 2012-07-13 Glenn Morris <rgm@gnu.org>
3214
3215 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3216
3217 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3218
3219 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3220 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3221
3222 2012-07-12 Glenn Morris <rgm@gnu.org>
3223
3224 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3225
3226 * process.c (init_process_emacs): Rename from init_process.
3227 The old name is also the name of a Mach system call.
3228 * lisp.h, emacs.c: Update for this name change.
3229 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3230 longer needed.
3231
3232 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3233
3234 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3235 memmove call that removes glyphs covered by the left truncation
3236 glyph. Improve commentary.
3237 (display_line): Fix display of continuation glyphs on GUI frames
3238 when the right fringe is turned off and variable-size fonts are
3239 used in the window. Move the code that appends a stretch glyph to
3240 produce_special_glyphs, so that it could be used for truncation
3241 and continuation glyphs alike.
3242 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3243 glyph of a suitably computed width, to align the special glyphs at
3244 the window margin. Code moved from display_line. (Bug#11832)
3245
3246 2012-07-12 Glenn Morris <rgm@gnu.org>
3247
3248 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3249
3250 * s/gnu-linux.h, s/hpux10-20.h:
3251 Do not unconditionally define HAVE_XRMSETDATABASE.
3252
3253 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3254
3255 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3256
3257 Fix typos that broke OS X build.
3258 Reported by Randal L. Schwartz in
3259 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3260 * nsterm.m (ns_timeout): Add missing local decl.
3261 (ns_get_color): snprintf -> sprintf, to fix typo.
3262
3263 2012-07-12 Glenn Morris <rgm@gnu.org>
3264
3265 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3266 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3267 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3268 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3269
3270 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3271 Move PTY_OPEN to configure.
3272
3273 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3274 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3275 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3276
3277 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3278
3279 Use empty_unibyte_string where applicable.
3280 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3281 * lread.c (read1): Likewise.
3282 * xsettings.c (syms_of_xsettings): Likewise.
3283
3284 2012-07-12 Glenn Morris <rgm@gnu.org>
3285
3286 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3287 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3288 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3289 * s/hpux10-20.h (RUN_TIME_REMAP):
3290 * s/bsd-common.h (TABDLY): Move to configure.
3291
3292 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3293
3294 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3295
3296 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3297 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3298
3299 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3300
3301 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3302 * s/template.h: Move NARROWPROTO to configure.
3303
3304 2012-07-11 Glenn Morris <rgm@gnu.org>
3305
3306 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3307 unused since 2011-01-17 change to systty.h.
3308
3309 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3310 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3311 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3312
3313 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3314
3315 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3316
3317 2012-07-11 Glenn Morris <rgm@gnu.org>
3318
3319 * s/darwin.h, s/gnu-linux.h, s/template.h:
3320 Move INTERRUPT_INPUT to configure.
3321
3322 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3323
3324 Minor adjustments to interning code.
3325 * lisp.h (intern, intern_c_string): Redefine as static inline
3326 wrappers for intern_1 and intern_c_string_1, respectively.
3327 (intern_1, intern_c_string_1): Rename prototypes.
3328 * lread.c (intern_1, intern_c_string_1, oblookup):
3329 Simplify Vobarray checking.
3330 * font.c (font_intern_prop): Likewise. Adjust comment.
3331 * w32font.c (intern_font_name): Likewise.
3332
3333 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3334
3335 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3336
3337 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3338 of Fcar/Fcdr if possible.
3339 * font.c (check_otf_features): Likewise.
3340 * fontset.c (Fnew_fontset): Likewise.
3341 * gnutls.c (Fgnutls_boot): Likewise.
3342 * minibuf.c (read_minibuf): Likewise.
3343 * msdos.c (IT_set_frame_parameters): Likewise.
3344 * xmenu.c (Fx_popup_dialog): Likewise.
3345 * w32menu.c (Fx_popup_dialog): Likewise.
3346
3347 2012-07-11 Glenn Morris <rgm@gnu.org>
3348
3349 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3350 since nothing has defined it on these platforms.
3351
3352 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3353 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3354
3355 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3356 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3357 Move CLASH_DETECTION to configure.
3358
3359 * s/gnu.h: Remove file, which is now empty.
3360
3361 * s/gnu.h, s/gnu-linux.h:
3362 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3363
3364 2012-07-11 John Wiegley <johnw@newartisans.com>
3365
3366 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3367 function attribute, so we only use it if it exists in the
3368 compiler.
3369
3370 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3371
3372 Avoid call to strlen in fast_c_string_match_ignore_case.
3373 * search.c (fast_c_string_match_ignore_case): Change to use
3374 length argument. Adjust users accordingly.
3375 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3376
3377 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3378
3379 Assume mkdir, rmdir.
3380 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3381 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3382
3383 Assume rename.
3384 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3385
3386 Assume perror.
3387 * s/hpux10-20.h (HAVE_PERROR): Remove.
3388 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3389 Remove dummy definition, as this problem was obsolete long ago.
3390
3391 Assume strerror.
3392 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3393
3394 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3395
3396 Avoid calls to strlen in font processing functions.
3397 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
3398 (font_open_by_name): Change to use length argument.
3399 Adjust users accordingly.
3400 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3401 Adjust prototypes.
3402 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3403 Change to return ptrdiff_t.
3404 (xfont_list_pattern, xfont_match): Use length returned by
3405 xfont_decode_coding_xlfd.
3406 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3407
3408 2012-07-11 Glenn Morris <rgm@gnu.org>
3409
3410 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3411 Move DONT_REOPEN_PTY to configure.
3412
3413 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3414 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3415
3416 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3417
3418 Remove "#define unix" that is no longer needed (Bug#11905).
3419 * s/aix4-2.h (unix): Remove; no longer needed.
3420
3421 EMACS_TIME simplification (Bug#11875).
3422 This replaces macros (which typically do not work in GDB)
3423 with functions, typedefs and enums, making the code easier to debug.
3424 The functional style also makes code easier to read and maintain.
3425 * systime.h: Include <sys/time.h> on all hosts, not just if
3426 WINDOWSNT, since 'struct timeval' is needed in general.
3427 (EMACS_TIME): Now a typedef, not a macro.
3428 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3429 not macros.
3430 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3431 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3432 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3433 (EMACS_TIME_LE): Now functions, not macros.
3434 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3435 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3436 which are not functions. All uses rewritten to use:
3437 (make_emacs_time): New function.
3438 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3439 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3440 not functions. All uses rewritten to use the following, respectively:
3441 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3442 (add_emacs_time, sub_emacs_time): New functions.
3443 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
3444 * fileio.c (Fcopy_file):
3445 * xterm.c (XTflash): Get the current time closer to when it's used.
3446 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3447
3448 * bytecode.c (targets): Suppress -Woverride-init warnings.
3449
3450 Simplify by avoiding confusing use of strncpy etc.
3451 * doc.c (Fsnarf_documentation):
3452 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3453 * frame.c (Fmake_terminal_frame):
3454 * gtkutil.c (get_utf8_string):
3455 * lread.c (openp):
3456 * nsmenu.m (ns_update_menubar):
3457 * regex.c (regerror):
3458 Prefer memcpy to strncpy and strncat when either will do.
3459 * fileio.c (Fsubstitute_in_file_name):
3460 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3461 (menu_separator_name_p):
3462 * nsmenu.m (ns_update_menubar):
3463 Prefer memcmp to strncmp when either will do.
3464 * nsterm.m: Include <ftoastr.h>.
3465 (ns_get_color):
3466 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3467 Prefer snprintf to strncpy.
3468 * nsterm.m (ns_term_init):
3469 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3470 * nsterm.m (ns_term_init):
3471 Avoid the need for strncpy, by using build_string or
3472 make_unibyte_string directly. Use dtoastr, not snprintf.
3473 * process.c (Fmake_network_process): Diagnose service names that
3474 are too long, rather than silently truncating them or creating
3475 non-null-terminated names.
3476 (Fnetwork_interface_info): Likewise, for interface names.
3477 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3478 Prefer sprintf to strncat.
3479 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3480 Prefer vsnprintf to vsprintf + strncpy.
3481
3482 2012-07-10 Glenn Morris <rgm@gnu.org>
3483
3484 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3485 Clarify fallback case.
3486
3487 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3488
3489 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3490 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3491 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
3492 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
3493 where argument type is known to be a Lisp_Cons.
3494
3495 2012-07-10 Tom Tromey <tromey@redhat.com>
3496
3497 * bytecode.c (BYTE_CODE_THREADED): New macro.
3498 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3499 (enum byte_code_op): New type.
3500 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3501 (exec_byte_code): Use them. Use token threading when applicable.
3502
3503 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3504
3505 Optimize pure C strings initialization.
3506 * lisp.h (make_pure_string): Fix prototype.
3507 (build_pure_c_string): New function, defined as static inline. This
3508 provides a better opportunity to optimize away calls to strlen when
3509 the function is called with compile-time constant argument.
3510 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3511 argument, adjust users accordingly. Use build_pure_c_string where
3512 appropriate.
3513 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3514 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3515 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3516
3517 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3518
3519 Avoid calls to strlen in miscellaneous functions.
3520 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3521 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3522 * lread.c (openp): Likewise.
3523
3524 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3525
3526 Avoid calls to strlen in path processing functions.
3527 * fileio.c (file_name_as_directory): Add comment. Change to add
3528 srclen argument and return the length of result. Adjust users
3529 accordingly.
3530 (directory_file_name): Fix comment. Change to add srclen argument,
3531 swap 1st and 2nd arguments to obey the common convention.
3532 Adjust users accordingly.
3533 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3534
3535 2012-07-10 Glenn Morris <rgm@gnu.org>
3536
3537 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3538 Move PENDING_OUTPUT_COUNT definition to configure.
3539
3540 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3541 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3542 * s/gnu.h (DATA_START): Move definitions to configure.
3543
3544 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3545 We include usg5-4-common.h, which defines them both.
3546
3547 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3548 O_RDONLY already includes it).
3549
3550 Stop ns builds setting the EMACSLOADPATH environment variable.
3551 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3552 Now it does not set EMACSLOADPATH, just returns the load-path string.
3553 * nsterm.h: Update accordingly.
3554 * lread.c [HAVE_NS]: Include nsterm.h.
3555 (init_lread) [HAVE_NS]: Use ns_load_path.
3556 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3557
3558 2012-07-09 Glenn Morris <rgm@gnu.org>
3559
3560 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3561 since the included bsd-common.h does so.
3562
3563 Stop ns builds setting the EMACSPATH environment variable.
3564 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3565 (ns_init_paths): Do not set EMACSPATH.
3566 * nsterm.h (ns_exec_path): Add it.
3567 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3568 Use ns_exec_path.
3569
3570 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3571
3572 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3573
3574 * process.c (wait_reading_process_output): 'waitchannels' was unset
3575 when read_kbd || !NILP (wait_for_cell); fix this.
3576
3577 Add GCC-style 'const' attribute to functions that can use it.
3578 * character.h (char_resolve_modifier_mask):
3579 * keyboard.h (make_ctrl_char):
3580 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3581 (init_character_once, next_almost_prime, init_fns, init_image)
3582 (flush_pending_output, init_sound):
3583 * mem-limits.h (start_of_data):
3584 * menu.h (finish_menu_items):
3585 Add ATTRIBUTE_CONST.
3586 * emacs.c (DEFINE_DUMMY_FUNCTION):
3587 Declare the dummy function with ATTRIBUTE_CONST.
3588 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3589 Add decls with ATTRIBUTE_CONST.
3590
3591 Minor improvements to make_formatted_string.
3592 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3593 where int is good enough, as vsprintf returns an int.
3594 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3595
3596 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3597
3598 Use make_formatted_string to avoid double length calculation.
3599 * lisp.h (make_formatted_string): New prototype.
3600 * alloc.c (make_formatted_string): New function.
3601 * buffer.c (Fgenerate_new_buffer_name): Use it.
3602 * dbus.c (syms_of_dbusbind): Likewise.
3603 * editfns.c (Fcurrent_time_zone): Likewise.
3604 * filelock.c (get_boot_time): Likewise.
3605 * frame.c (make_terminal_frame, set_term_frame_name)
3606 (x_report_frame_params): Likewise.
3607 * image.c (gs_load): Likewise.
3608 * minibuf.c (get_minibuffer): Likewise.
3609 * msdos.c (dos_set_window_size): Likewise.
3610 * process.c (make_process): Likewise.
3611 * xdisp.c (ensure_echo_area_buffers): Likewise.
3612 * xsettings.c (apply_xft_settings): Likewise.
3613
3614 2012-07-09 Glenn Morris <rgm@gnu.org>
3615
3616 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3617 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3618 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3619 * nsterm.h (ns_etc_directory): Add it.
3620 * callproc.c [HAVE_NS]: Include nsterm.h.
3621 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3622
3623 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3624
3625 Move marker debugging code under MARKER_DEBUG.
3626 * marker.c (MARKER_DEBUG): Move marker debugging code under
3627 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3628 for bootstrap with --enable-checking (~3x slowdown reported
3629 by Juanma Barranquero <lekktu@gmail.com>).
3630 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3631
3632 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3633
3634 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3635 See <http://bugs.gnu.org/11825#29>.
3636
3637 2012-07-08 Eli Zaretskii <eliz@gnu.org>
3638
3639 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3640 has no font, use the frame's font. (Bug#11813)
3641 (display_line): Add commentary about displaying truncation glyphs
3642 on GUI frames.
3643 (produce_special_glyphs): Move here from term.c.
3644
3645 * term.c (produce_special_glyphs): Move to xdisp.c.
3646
3647 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3648 section.
3649
3650 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3651
3652 * xdisp.c (display_line): Avoid warning about implicit declaration
3653 of FRAME_FONT.
3654
3655 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3656
3657 * lisp.h: Remove empty conditional.
3658
3659 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3660
3661 * lread.c (load_path_check): Now static.
3662
3663 Fix some minor --with-ns problems found by static checking.
3664 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3665 (x_set_font) [!HAVE_X_WINDOWS]:
3666 * image.c (xpm_load_image) [HAVE_NS]:
3667 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3668 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3669 Remove unused local.
3670 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3671 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3672 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3673 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3674 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3675 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3676 Fix pointer signedness problem.
3677 * xfaces.c (FRAME_X_FONT_TABLE):
3678 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3679
3680 2012-07-07 Glenn Morris <rgm@gnu.org>
3681
3682 * lread.c (load_path_check): New function, split from init_lread.
3683 (init_lread): Reorganize. Motivation:
3684 If EMACSLOADPATH is set, check/warn about that rather than the
3685 defaults, which we are not going to use. Hence we can remove
3686 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3687 Don't warn if site-lisp directories are missing.
3688 If not installed, start from a blank load-path, since
3689 PATH_LOADSEARCH refers to the eventual installation directories.
3690
3691 2012-07-07 Eli Zaretskii <eliz@gnu.org>
3692
3693 Support truncation and continuation glyphs on GUI frames, when
3694 fringes are disabled. (Bug#11832)
3695 * xdisp.c (init_iterator): Get dimensions of truncation and
3696 continuation glyphs even if on GUI frames.
3697 Adjust it->last_visible_x on GUI frames when the left or right fringes,
3698 or both, are absent.
3699 (start_display, move_it_in_display_line_to): Handle the case of a
3700 GUI frame without a fringe to display continuation or truncation
3701 glyphs.
3702 (insert_left_trunc_glyphs): Support GUI frames: make sure
3703 truncation glyphs overwrite enough glyphs from the current line to
3704 have sufficient space in pixels.
3705 (display_line): Support truncation and continuation glyphs on GUI
3706 frames. If some spare pixels are left on the line after inserting
3707 the truncation glyphs, fill that space with a stretch glyph of a
3708 suitably computed width.
3709
3710 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3711 produce_glyphs, to support GUI sessions.
3712
3713 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3714
3715 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3716
3717 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3718
3719 Do not require float-time's arg to fit in time_t (Bug#11825).
3720 This works better on hosts where time_t is unsigned, and where
3721 float-time is applied to the (negative) difference between two times.
3722 * editfns.c (decode_time_components): Last arg is now double *,
3723 not int *, and means to store all the result as a double, without
3724 worrying about whether the seconds part fits in time_t.
3725 All callers changed.
3726 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3727 All callers changed.
3728 (Ffloat_time): Do not fail merely because the specified time falls
3729 outside of time_t range.
3730
3731 2012-07-07 Glenn Morris <rgm@gnu.org>
3732
3733 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3734 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3735 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3736
3737 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
3738
3739 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3740 Update dependencies.
3741
3742 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3743
3744 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3745
3746 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3747 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3748 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3749 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3750 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3751 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3752
3753 * xfont.c (compare_font_names): Redo to omit the need for casts.
3754
3755 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3756
3757 * xfns.c (Fx_change_window_property): Doc fix.
3758 * w32fns.c (Fx_change_window_property): Doc fix.
3759
3760 * w32fns.c (Fx_window_property): Accept the same arguments as the
3761 X Windows version. Doc fix.
3762 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3763
3764 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
3765 Eli Zaretskii <eliz@gnu.org>
3766
3767 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3768 Windows-specific code from nt/config.nt moved here.
3769 Obsolete settings removed.
3770
3771 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3772
3773 * process.c: Avoid unnecessary calls to gettime.
3774 (wait_reading_process_output): Don't get the time of day
3775 when gobbling data immediately and not waiting, as there's no need
3776 for it in that case. This removes a FIXME.
3777
3778 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3779
3780 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3781 is defined (Bug#11768).
3782
3783 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3784
3785 Fix marker debugging code.
3786 * marker.c (byte_char_debug_check): Do not perform the check
3787 if buffer is not multibyte.
3788 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3789 Call byte_char_debug_check with correct arguments.
3790
3791 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3792
3793 Compile marker debugging code only if ENABLE_CHECKING is defined.
3794 * marker.c (byte_char_debug_check, count_markers):
3795 Use only if ENABLE_CHECKING is defined.
3796 (byte_debug_flag): Remove.
3797 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3798 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3799
3800 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3801
3802 Avoid code repetition in marker-related functions.
3803 * marker.c (attach_marker): New function.
3804 (Fset_marker, set_marker_restricted, set_marker_both)
3805 (set_marker_restricted_both): Use it.
3806 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3807 Consistently rename charno to charpos.
3808 (marker_position): Add eassert.
3809 (marker_byte_position): Convert to eassert.
3810
3811 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3812
3813 Simplify list operations in unchain_overlay and unchain_marker.
3814 * buffer.c (unchain_overlay): Simplify. Add comment.
3815 * marker.c (unchain_marker): Simplify. Fix comments.
3816
3817 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3818
3819 Introduce fast path for the widely used marker operation.
3820 * alloc.c (build_marker): New function.
3821 * lisp.h (build_marker): New prototype.
3822 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3823 * composite.c (autocmp_chars): Likewise.
3824 * editfns.c (buildmark): Remove.
3825 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3826 (save_restriction_save): Use build_marker.
3827 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3828 * window.c (save_window_save): Likewise.
3829
3830 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3831
3832 Do not use Fdelete_overlay in delete_all_overlays
3833 to avoid redundant calls to unchain_overlay.
3834 * buffer.c (drop_overlay): New function.
3835 (delete_all_overlays, Fdelete_overlay): Use it.
3836 * minibuf.c (get_minibuffer): Fix comment.
3837
3838 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3839
3840 Port to OpenBSD 5.1 amd64.
3841 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3842 This is needed for OpenBSD, and should be harmless on all BSD systems.
3843 Also, include <sys/sysctl.h>, as it should be available on all
3844 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3845 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3846 use p_pid member, not kp_proc.pid.
3847
3848 2012-07-06 Glenn Morris <rgm@gnu.org>
3849
3850 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3851
3852 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3853
3854 More xmalloc and related cleanup.
3855 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3856 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3857 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3858 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3859 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3860 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3861 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3862 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3863 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3864 * xterm.c:
3865 Omit needless casts involving void * pointers and allocation.
3866 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3867 as the former is more robust if P's type is changed.
3868 Prefer xzalloc to xmalloc + memset 0.
3869 Simplify malloc-or-realloc to realloc.
3870 Don't worry about xmalloc returning a null pointer.
3871 Prefer xstrdup to xmalloc + strcpy.
3872 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3873 growing it.
3874 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3875 alloca of a constant.
3876
3877 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3878
3879 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3880 hscroll is larger than the line width. Fixes long and futile
3881 looping inside extend_face_to_end_of_line (on a TTY) producing
3882 glyphs that are not needed and thrown away.
3883
3884 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3885
3886 * marker.c (set_marker_restricted_both): Simplify by using
3887 clip_to_bounds.
3888
3889 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3890
3891 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3892
3893 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3894
3895 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3896 not defined (Bug#11768).
3897 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3898 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3899 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3900 followed by gtk_box_set_homogeneous (Bug#11768).
3901 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
3902 (update_theme_scrollbar_width, xg_create_scroll_bar):
3903 Use gtk_scrollbar_new (Bug#11768).
3904 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3905 (is_box_type): New function (Bug#11768).
3906 (xg_tool_item_stale_p): Call is_box_type.
3907 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
3908 with default display (Bug#11768).
3909
3910 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3911
3912 * xdisp.c (window_hscroll_limited): New function.
3913 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3914 coordinates when window's hscroll is set to insanely large
3915 values. (Bug#11857)
3916
3917 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
3918
3919 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3920 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3921
3922 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3923
3924 Cleanup xmalloc.
3925 * lisp.h (xzalloc): New prototype. Omit needless casts.
3926 * alloc.c (xzalloc): New function. Omit needless casts.
3927 * charset.c: Omit needless casts. Convert all calls to
3928 xmalloc with following memset to xzalloc.
3929 * dispnew.c: Likewise.
3930 * fringe.c: Likewise.
3931 * image.c: Likewise.
3932 * sound.c: Likewise.
3933 * term.c: Likewise.
3934 * w32fns.c: Likewise.
3935 * w32font.c: Likewise.
3936 * w32term.c: Likewise.
3937 * xfaces.c: Likewise.
3938 * xfns.c: Likewise.
3939 * xterm.c: Likewise.
3940 * atimer.c: Omit needless casts.
3941 * buffer.c: Likewise.
3942 * callproc.c: Likewise.
3943 * ccl.c: Likewise.
3944 * coding.c: Likewise.
3945 * composite.c: Likewise.
3946 * doc.c: Likewise.
3947 * doprnt.c: Likewise.
3948 * editfns.c: Likewise.
3949 * emacs.c: Likewise.
3950 * eval.c: Likewise.
3951 * filelock.c: Likewise.
3952 * fns.c: Likewise.
3953 * gtkutil.c: Likewise.
3954 * keyboard.c: Likewise.
3955 * lisp.h: Likewise.
3956 * lread.c: Likewise.
3957 * minibuf.c: Likewise.
3958 * msdos.c: Likewise.
3959 * print.c: Likewise.
3960 * process.c: Likewise.
3961 * region-cache.c: Likewise.
3962 * search.c: Likewise.
3963 * sysdep.c: Likewise.
3964 * termcap.c: Likewise.
3965 * terminal.c: Likewise.
3966 * tparam.c: Likewise.
3967 * w16select.c: Likewise.
3968 * w32.c: Likewise.
3969 * w32reg.c: Likewise.
3970 * w32select.c: Likewise.
3971 * w32uniscribe.c: Likewise.
3972 * widget.c: Likewise.
3973 * xdisp.c: Likewise.
3974 * xmenu.c: Likewise.
3975 * xrdb.c: Likewise.
3976 * xselect.c: Likewise.
3977
3978 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3979
3980 * fileio.c (time_error_value): Check the right error number.
3981 Problem reported by Troels Nielsen in
3982 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3983
3984 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3985
3986 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3987 This should be fixed in a better way; see Eli Zaretskii in
3988 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3989 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3990
3991 * fileio.c (time_error_value): Rename from special_mtime.
3992 The old name's problems were noted by Eli Zaretskii in
3993 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3994
3995 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3996 This variable's comment says Emacs needs at least one GDB-visible
3997 symbol of type enum pvec_type, to work around GDB problems.
3998 The symbol's value doesn't matter.
3999
4000 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4001 that causes compilation to fail on pre-C99 compilers.
4002
4003 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4004
4005 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4006 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4007
4008 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4009
4010 * buffer.c (init_buffer_once): Fix initialization of
4011 headers for buffer_defaults and buffer_local_symbols.
4012 Reported by Juanma Barranquero <lekktu@gmail.com>.
4013
4014 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4015
4016 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4017 * lisp.h (enum pvec_type): Use fewer bits.
4018 (PSEUDOVECTOR_SIZE_BITS): New constant.
4019 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4020 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4021 change in pvec_type.
4022 (PSEUDOVECTOR_TYPEP): New macro.
4023 (TYPED_PSEUDOVECTORP): Use it.
4024 * fns.c (internal_equal): Adapt code to extract pvectype.
4025 * emacs.c (gdb_pvec_type): Update type.
4026 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4027 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4028 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4029 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4030 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4031 abusing vector->header.next.nbytes.
4032 (live_vector_p): Use PVEC_TYPE.
4033 (mark_object): Adapt code to extract pvectype. Use switch.
4034
4035 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4036
4037 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4038 Tighten new eassert a bit.
4039
4040 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4041
4042 Fix compilation with --enable-gcc-warnings and -O1
4043 optimization level.
4044 * doprnt.c (doprnt): Change type of tem to int, initialize
4045 to avoid compiler warning. Add eassert.
4046 * search.c (simple_search): Initialize match_byte to avoid
4047 compiler warning. Add eassert.
4048
4049 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4050
4051 Avoid weird behavior with large horizontal scrolls.
4052 Without this change, for example, large hscroll values would
4053 mess up Emacs's display on Fedora 15 x86, presumably due to
4054 overflows in int calculations in the display code.
4055 Also, if buffers had long lines, Emacs would freeze.
4056 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4057 (set_window_hscroll): New function, containing the old guts of
4058 Fset_window_hscroll. Return the clipped value.
4059 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4060 This avoids the need to check against PTRDIFF_MAX.
4061
4062 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4063
4064 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4065
4066 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4067
4068 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4069
4070 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4071 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4072 since GCC 4.4.6 issues a bogus warning for them.
4073
4074 Fix bugs in file timestamp newness comparisons.
4075 * fileio.c (Ffile_newer_than_file_p):
4076 * lread.c (Fload): Use full timestamp resolution of files,
4077 not just the 1-second resolution, so that files that are only
4078 slightly newer still count as newer.
4079 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4080 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4081
4082 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4083
4084 * fileio.c: Improve handling of file time marker. (Bug#11852)
4085 (special_mtime): New function.
4086 (Finsert_file_contents, Fverify_visited_file_modtime):
4087 Use it to set special mtime values consistently.
4088
4089 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4090
4091 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4092 marker for non-existing file. (Bug#11852)
4093
4094 2012-07-03 Glenn Morris <rgm@gnu.org>
4095
4096 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4097 and did not make it into globals.h).
4098
4099 2012-07-03 Tom Tromey <tromey@redhat.com>
4100
4101 * window.c (Fset_window_margins, Fset_window_fringes)
4102 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4103 * textprop.c (Fprevious_property_change): No longer static.
4104 * syntax.c (Fsyntax_table_p): No longer static.
4105 * process.c (Fget_process, Fprocess_datagram_address): No longer
4106 static.
4107 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4108 * keyboard.c (Fcommand_execute): No longer static.
4109 Remove EXFUN.
4110 * insdel.c (Fcombine_after_change_execute): No longer static.
4111 * image.c (Finit_image_library): No longer static.
4112 * fileio.c (Fmake_symbolic_link): No longer static.
4113 * eval.c (Ffetch_bytecode): No longer static.
4114 * editfns.c (Fuser_full_name): No longer static.
4115 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4116 No longer static.
4117 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4118 static.
4119 * dired.c (Ffile_attributes): No longer static.
4120 * composite.c (Fcomposition_get_gstring): No longer static.
4121 * callproc.c (Fgetenv_internal): No longer static.
4122
4123 * ccl.h: Remove EXFUNs.
4124 * buffer.h: Remove EXFUNs.
4125 * dispextern.h: Remove EXFUNs.
4126 * intervals.h: Remove EXFUNs.
4127 * fontset.h: Remove EXFUN.
4128 * font.h: Remove EXFUNs.
4129 * dosfns.c (system_process_attributes): Remove EXFUN.
4130 * keymap.h: Remove EXFUNs.
4131 * lisp.h: Remove EXFUNs.
4132 * w32term.h: Remove EXFUNs.
4133 * window.h: Remove EXFUNs.
4134 * xsettings.h: Remove EXFUN.
4135 * xterm.h: Remove EXFUN.
4136
4137 2012-07-03 Glenn Morris <rgm@gnu.org>
4138
4139 * lisp.h (Frandom): Make it visible to C.
4140 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4141 buffer for invisible buffers. (Bug#1229)
4142
4143 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4144
4145 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4146 values which aren't power of 2.
4147 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4148 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4149 accordingly.
4150
4151 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4152
4153 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4154
4155 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4156
4157 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4158
4159 * alloc.c (allocate_vector_block): Remove redundant
4160 calls to mallopt if DOUG_LEA_MALLOC is defined.
4161 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4162 avoid calls to mallopt if zero_vector is returned.
4163
4164 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4165
4166 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4167 is enabled, avoid dereferencing NULL current_sblock if
4168 running undumped.
4169
4170 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4171
4172 Cleanup basic buffer management.
4173 * buffer.h (struct buffer): Change layout to use generic vector
4174 marking code. Fix some comments. Change type of 'clip_changed'
4175 to bitfield. Remove unused #ifndef old.
4176 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4177 (GET_OVERLAYS_AT): Fix indentation.
4178 (for_each_per_buffer_object_at): New macro.
4179 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4180 (Fbuffer_local_variables): Use it.
4181 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4182 * alloc.c (allocate_buffer): Adjust to match new layout of
4183 struct buffer. Fix comment.
4184 (mark_overlay): New function.
4185 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4186 Lisp area of struct buffer.
4187 (mark_object): Use it. Adjust marking of misc objects
4188 and related comments.
4189
4190 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4191
4192 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4193 wrapper that is not needed because the wrapped code is a no-op (zero
4194 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4195 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4196
4197 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4198
4199 * alloc.c (mark_buffer): Simplify. Remove prototype.
4200 (mark_object): Add comment. Reorganize marking of vector-like
4201 objects. Use CHECK_LIVE for all vector-like objects except buffers
4202 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4203 Avoid redundant calls to mark_vectorlike for bool vectors.
4204
4205 2012-06-30 Glenn Morris <rgm@gnu.org>
4206
4207 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4208
4209 * epaths.in (PATH_SITELOADSEARCH): New.
4210 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4211 This is rather than relying on --enable-locallisppath elements
4212 having "site-lisp" in their names. (Bug#10208#25, 11658)
4213
4214 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4215
4216 * w32proc.c (sys_select): Accept and ignore one more argument.
4217
4218 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4219
4220 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4221 (pselect) [!MS_DOS]: Redirect to sys_select.
4222
4223 * sysdep.c: Don't include dos.h and dosfns.h.
4224
4225 * process.c (sys_select):
4226 * msdos.c (sys_select): Accept one more argument and ignore it.
4227
4228 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4229 adapt data types and code to that.
4230
4231 * dosfns.c:
4232 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4233 which clashes with the gnulib function of the same name.
4234
4235 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4236
4237 * font.c (font_style_to_value, font_style_symbolic)
4238 (font_prop_validate_style): Add type checks for values in
4239 font_style_table.
4240
4241 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4242 argument.
4243 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4244 uses.
4245
4246 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4247
4248 * xdisp.c (try_window_id): Undo last change.
4249
4250 * w32.c (getwd): Adjust commentary about startup_dir.
4251 (init_environment): Always call sys_access, even in non-MSVC
4252 builds. Don't chdir to the directory of the Emacs executable.
4253 This undoes code from 1997 which was justified by the need to
4254 "avoid conflicts when removing and renaming directories". But its
4255 downside was that every relative file name was being interpreted
4256 relative to the directory of the Emacs executable, which can never
4257 be TRT. In particular, it broke sys_access when called with
4258 relative file names.
4259 (sys_access): Map GetLastError to errno.
4260
4261 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4262
4263 * window.h (struct window): Change type of 'fringes_outside_margins'
4264 to bitfield. Fix comment. Adjust users accordingly.
4265 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4266 Adjust comment.
4267 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4268 to ptrdiff_t.
4269
4270 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4271
4272 * gnutls.c (emacs_gnutls_handshake):
4273 Add QUIT to make the loop interruptible.
4274
4275 2012-06-29 Glenn Morris <rgm@gnu.org>
4276
4277 * charset.c (init_charset): Make lack of etc/charsets fatal.
4278
4279 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4280
4281 * editfns.c (region_limit): Fix type mismatch.
4282
4283 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4284
4285 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4286 undefined. Convert from xassert to eassert.
4287 * nsmenu.m: Convert from xassert to eassert.
4288 * nsterm.m: Likewise.
4289
4290 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4291
4292 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4293
4294 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4295
4296 Avoid integer overflow on scroll-left and scroll-right.
4297 * window.c (HSCROLL_MAX): New macro.
4298 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4299 overflow when requested scroll falls outside ptrdiff_t range.
4300
4301 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4302
4303 * window.h (struct window): Change type of 'hscroll',
4304 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4305 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4306 Adjust users accordingly.
4307 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4308 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4309 from EMACS_INT to ptrdiff_t.
4310 (make_window): Omit redundant initialization.
4311
4312 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4313
4314 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4315
4316 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4317
4318 * window.h (struct window): Change type of 'use_time' and
4319 'sequence_number' from Lisp_Object to int.
4320 * frame.c (make_frame): Adjust users accordingly.
4321 * print.c (print_object): Likewise.
4322 * window.c (select_window, Fwindow_use_time, make_parent_window)
4323 (make_window): Likewise.
4324
4325 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4326
4327 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4328 enabled with --enable-checking=[all,glyphs] configure option.
4329 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4330 adjust comments accordingly.
4331 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4332 undefined, adjust comments accordingly.
4333 * image.c: Likewise.
4334 * scroll.c: Likewise.
4335 * w32fns.c: Likewise.
4336 * w32term.c: Likewise.
4337 * xdisp.c: Likewise.
4338 * xfaces.c: Likewise.
4339 * xfns.c: Likewise.
4340 * xterm.c: Likewise.
4341
4342 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4343
4344 Generalize run-time debugging checks.
4345 * dispextern.h (XASSERTS): Remove.
4346 * fontset.c (xassert): Remove.
4347 Convert from xassert to eassert.
4348 * alloc.c: Convert from xassert to eassert.
4349 * bidi.c: Likewise.
4350 * dispnew.c: Likewise.
4351 * fns.c: Likewise.
4352 * fringe.c: Likewise.
4353 * ftfont.c: Likewise.
4354 * gtkutil.c: Likewise.
4355 * image.c: Likewise.
4356 * keyboard.c: Likewise.
4357 * menu.c: Likewise.
4358 * process.c: Likewise.
4359 * scroll.c: Likewise.
4360 * sound.c: Likewise.
4361 * term.c: Likewise.
4362 * w32console.c: Likewise.
4363 * w32fns.c: Likewise.
4364 * w32term.c: Likewise.
4365 * window.c: Likewise.
4366 * xdisp.c: Likewise.
4367 * xfaces.c: Likewise.
4368 * xfns.c: Likewise.
4369 * xselect.c: Likewise.
4370 * xterm.c: Likewise.
4371
4372 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4373
4374 * fns.c (maybe_resize_hash_table): Output message when growing the
4375 purify-hashtable.
4376
4377 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4378
4379 * alloc.c (allocate_string_data): Remove dead code.
4380 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4381 avoid GCC warning about unused macro.
4382
4383 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4384
4385 * alloc.c (allocate_string): Omit intervals initialization.
4386 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4387 as in make_pure_string and make_pure_c_string.
4388
4389 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4390
4391 * alloc.c (allocate_string): Fix last change.
4392
4393 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4394
4395 * alloc.c (allocate_string): Remove two redundant calls
4396 to memset, add explicit initialization where appropriate.
4397
4398 2012-06-27 Glenn Morris <rgm@gnu.org>
4399
4400 * lisp.mk (lisp): Remove paths.elc.
4401
4402 2012-06-27 Chong Yidong <cyd@gnu.org>
4403
4404 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4405
4406 2012-06-26 John Wiegley <johnw@newartisans.com>
4407
4408 * unexmacosx.c (copy_data_segment): Add two section names used
4409 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4410
4411 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4412 when building with Clang.
4413
4414 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4415
4416 * eval.c (Fapply): Allow calling it with a single argument.
4417
4418 2012-06-26 Eli Zaretskii <eliz@gnu.org>
4419
4420 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4421 _stricmp and _strnicmp.
4422 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4423
4424 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4425
4426 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4427 allocated window.
4428 (allocate_process): Likewise for new process.
4429 (allocate_terminal): Change to use offsetof.
4430 (allocate_frame): Likewise.
4431 * frame.c (make_frame): Omit redundant initialization.
4432 * window.c (make_parent_window): Use memset.
4433 (make_window): Omit redundant initialization.
4434 * process.c (make_process): Omit redundant initialization.
4435 * terminal.c (create_terminal): Likewise.
4436
4437 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4438
4439 * term.c (delete_tty): Remove redundant call to memset.
4440
4441 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4442
4443 * alloc.c: Remove build_string.
4444 * lisp.h: Define build_string as static inline. This provides
4445 a better opportunity to optimize away calls to strlen when the
4446 function is called with compile-time constant argument.
4447 * image.c (imagemagick_error): Convert to build_string.
4448 * w32proc.c (sys_spawnve): Likewise.
4449 * xterm.c (x_term_init): Likewise.
4450
4451 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4452
4453 Use sprintf return value instead of invoking strlen on result.
4454 In the old days this wasn't portable, since some sprintf
4455 implementations returned char *. But they died out years ago and
4456 Emacs already assumes sprintf returns int.
4457 Similarly for float_to_string.
4458 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4459 * ccl.c (ccl_driver):
4460 * character.c (string_escape_byte8):
4461 * data.c (Fnumber_to_string):
4462 * doprnt.c (doprnt):
4463 * print.c (print_object):
4464 * xdisp.c (message_dolog):
4465 * xfns.c (syms_of_xfns):
4466 Use sprintf or float_to_string result to avoid need to call strlen.
4467 * data.c (Fnumber_to_string):
4468 Use make_unibyte_string, since the string must be ASCII.
4469 * lisp.h, print.c (float_to_string): Now returns int length.
4470 * term.c (produce_glyphless_glyph):
4471 Use sprintf result rather than recomputing it.
4472
4473 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4474 * Makefile.in (ALL_CFLAGS):
4475 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4476 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4477
4478 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4479
4480 * dispextern.h (xstrcasecmp): Define to library function
4481 strcasecmp if available.
4482 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4483
4484 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4485
4486 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4487 Avoid comma operator.
4488 * menu.c (push_submenu_start, push_submenu_end)
4489 (push_left_right_boundary, push_menu_pane): Likewise.
4490 * msdos.c (dos_rawgetc): Likewise.
4491
4492 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4493
4494 * xfns.c (xic_create_fontsetname): Remove redundant calls
4495 to memset.
4496
4497 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4498
4499 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4500 sprintf already null-terminates its output.
4501
4502 * xfns.c (x_window): Remove redundant cast.
4503
4504 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4505
4506 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4507 `const char *' to `char *' to avoid compiler warning.
4508
4509 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4510
4511 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4512 instead of truncating it to 63 (admittedly a generous limit).
4513
4514 * process.c: Fix spelling and caps in comments.
4515
4516 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4517
4518 * emacs.c (setpgrp): Remove definition, unused.
4519 * sysdep.c (setpgrp): Remove definition, not used in this file.
4520
4521 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
4522
4523 * makefile.w32-in: Update dependencies.
4524
4525 2012-06-24 Eli Zaretskii <eliz@gnu.org>
4526
4527 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4528 (SYSTIME_H): Add nt/inc/sys/time.h.
4529
4530 * systime.h [WINDOWSNT]: Include sys/time.h.
4531
4532 * s/ms-w32.h (struct timespec): Definition moved from
4533 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4534
4535 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4536
4537 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4538 * buffer.h (buffer_slot_type_mismatch):
4539 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4540 * eval.c (unwind_to_catch):
4541 * image.c (my_png_error, my_error_exit):
4542 * keyboard.c (quit_throw_to_read_char, user_error)
4543 (Fexit_recursive_edit, Fabort_recursive_edit):
4544 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4545 (wrong_type_argument, buffer_overflow, __executable_start)
4546 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4547 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4548 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4549 (fatal):
4550 (child_setup) [!DOS_NT]:
4551 * lread.c (end_of_file_error, invalid_syntax):
4552 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4553 * puresize.h (pure_write_error):
4554 * search.c (matcher_overflow):
4555 * sound.c (sound_perror, alsa_sound_perror):
4556 * sysdep.c, syssignal.h (croak):
4557 * term.c (maybe_fatal, vfatal):
4558 * textprop.c (text_read_only):
4559 * undo.c (user_error):
4560 * unexmacosx.c (unexec_error):
4561 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4562 Use _Noreturn rather than NO_RETURN.
4563 No need for separate decl merely because of _Noreturn.
4564 * sound.c (sound_warning, parse_sound):
4565 Remove unnecessary forward decls.
4566
4567 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4568
4569 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4570 * lisp.h (WAIT_READING_MAX): New macro.
4571 * dispnew.c (Fsleep_for, sit_for):
4572 * keyboard.c (kbd_buffer_get_event):
4573 * process.c (Faccept_process_output):
4574 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4575 This improves on the previous patch, which introduced a bug
4576 when time_t is unsigned and as wide as intmax_t.
4577 See <http://bugs.gnu.org/9000#51>.
4578
4579 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4580
4581 * dispnew.c (sit_for, Fsleep_for):
4582 * keyboard.c (kbd_buffer_get_event):
4583 * process.c (Faccept_process_output): Avoid compiler warnings when
4584 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4585
4586 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
4587
4588 * makefile.w32-in: Update dependencies.
4589
4590 * w32.c (ltime): Add return type and declare static.
4591 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4592
4593 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4594
4595 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4596 Privately reported by Herbert J. Skuhra.
4597 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4598 All uses changed.
4599 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4600 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4601
4602 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4603
4604 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4605 last argument of make_unibyte_string.
4606
4607 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4608 language ID in the event parameters.
4609
4610 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4611 event.code, not the obscure "character set ID".
4612
4613 2012-06-23 Chong Yidong <cyd@gnu.org>
4614
4615 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4616
4617 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4618
4619 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4620 * w32.c (fdutimens): New function.
4621
4622 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4623
4624 * s/ms-w32.h (pselect): Redirect to sys_select.
4625
4626 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4627
4628 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4629 in the logic of incrementing and decrementing the value of
4630 use_relocatable_buffers.
4631
4632 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4633
4634 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4635 Privately reported by Herbert J. Skuhra.
4636 [__FreeBSD__]: Remove "*/" typo after "#include".
4637 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4638 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4639 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4640 Don't assume EMACS_TIME and struct timeval are the same type.
4641
4642 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4643
4644 Support higher-resolution time stamps (Bug#9000).
4645 The time stamps are only nanosecond-resolution at the C level,
4646 since that's the best that any real-world system supports now.
4647 But they are picosecond-resolution at the Lisp level, as that's
4648 easy, and leaves room for future OS improvements.
4649
4650 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4651 (LIBES): Use it.
4652
4653 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4654 Don't get current time unless it's needed.
4655
4656 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4657 now provides it if it's absent.
4658 (start_atimer): Port to higher-res time stamps.
4659 Check for time stamp overflow. Don't get current time more
4660 often than is needed.
4661
4662 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4663 Include systime.h, not time.h.
4664 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4665
4666 * dired.c: Include stat-time.h.
4667 (Ffile-attributes): File times now have higher resolution.
4668
4669 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4670 (struct image): Timestamp now has higher resolution.
4671
4672 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4673 has at least microseconds now. All uses removed.
4674 (update_frame, update_single_window, update_window, update_frame_1)
4675 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
4676 (duration_to_sec_usec): Remove; no longer needed.
4677
4678 * editfns.c (time_overflow): Now extern.
4679 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4680 (float-time, Fformat_time_string, Fcurrent_time_string)
4681 (Fcurrent_time_zone): Accept and generate higher-resolution
4682 time stamps.
4683 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4684 (decode_time_components, lisp_seconds_argument): New functions.
4685 (make_time): Now static.
4686 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4687 Report an error if the time is invalid, rather than having the caller
4688 do that.
4689
4690 * fileio.c: Include <stat-time.h>
4691 (Fcopy_file): Copy higher-resolution time stamps.
4692 Prefer to set the time stamp via a file descriptor if that works.
4693 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4694 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4695 (Fvisited_file_modtime, Fset_visited_file_modtime):
4696 Support higher-resolution time stamps.
4697
4698 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4699
4700 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4701
4702 * image.c (prepare_image_for_display, clear_image_cache)
4703 (lookup_image): Port to higer-resolution time stamps.
4704
4705 * keyboard.c (start_polling, bind_polling_period):
4706 Check for time stamp overflow.
4707 (read_char, kbd_buffer_get_event, timer_start_idle)
4708 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4709 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4710 Port to higher-resolution time stamps. Do not assume time_t is signed.
4711 (decode_timer): New function. Timers are now vectors of length 9,
4712 not 8, to accommodate the picosecond component.
4713 (timer_check_2): Use it.
4714
4715 * nsterm.m (select_timeout, timeval_subtract): Remove.
4716 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4717 as they're a bit more accurate and handle overflow better.
4718 (ns_select): Change prototype to be compatible with pselect.
4719 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4720 * nsterm.h (ns_select): Adjust prototype.
4721
4722 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4723 us-resolution time stamps.
4724 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4725
4726 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4727
4728 * lisp.h (time_overflow): New decl.
4729 (wait_reading_process_output): First arg is now intmax_t, not int,
4730 to accommodate larger waits.
4731
4732 * process.h (struct Lisp_Process.read_output_delay):
4733 Now counts nanoseconds, not microseconds.
4734 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4735 EMACS_HAS_USECS.
4736 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4737 (wait_reading_process_output):
4738 Port to ns-resolution time stamps.
4739 (Faccept_process_output, wait_reading_process_output):
4740 Check for time stamp overflow. Do not assume time_t is signed.
4741 (select_wrapper): Remove; we now use pselect.
4742 (Fprocess_attributes): Now generates ns-resolution time stamps.
4743
4744 * sysdep.c: Include utimens.h. Don't include utime.h
4745 or worry about struct utimbuf; gnulib does that for us now.
4746 (gettimeofday): Remove; gnulib provides a substitute.
4747 (make_timeval): New function.
4748 (set_file_times): Now sets ns-resolution time stamps.
4749 New arg FD; all uses changed.
4750 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4751 (system_process_attributes):
4752 Now returns ns-resolution time stamp. All uses changed.
4753 Check for time stamp overflow.
4754
4755 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4756 provides a substitute now.
4757
4758 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4759 since it guarantees struct timespec.
4760 (EMACS_TIME): Now struct timespec, so that we can support
4761 ns-resolution time stamps.
4762 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4763 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4764 (EMACS_USECS): Remove.
4765 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4766 so multiply the arg by 1000 before storing it.
4767 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4768 New macros.
4769 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4770 Port to ns-resolution time stamps.
4771 (EMACS_TIME_NEG_P): Remove; replaced by....
4772 (EMACS_TIME_SIGN): New macro.
4773 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4774 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4775 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4776 (make_timeval, make_lisp_time, decode_time_components): New decls.
4777 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4778 that it mishandled time_t overflow. You can't compare by subtracting!
4779 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4780 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4781
4782 * term.c: Include <sys/time.h>.
4783 (timeval_to_Time): New function, for proper overflow wraparound.
4784 (term_mouse_position, term_mouse_click): Use it.
4785
4786 * undo.c (record_first_change): Support higher-resolution time stamps
4787 in the undo buffer.
4788 (Fprimitive_undo): Use them when restoring time stamps.
4789
4790 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4791 (w32_get_internal_run_time):
4792 Port to higher-resolution Emacs time stamps.
4793 (ltime): Now accepts single 64-bit integer, as that's more convenient
4794 for callers.
4795
4796 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4797
4798 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4799 for compatibility with pselect. Support ns-resolution time stamps.
4800
4801 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4802
4803 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4804 Check for time stamp overflow, and support ns-resolution time stamps.
4805
4806 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4807 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4808 (timeval_subtract): Remove; no longer needed.
4809 (XTflash, XTring_bell, x_wait_for_event):
4810 Port to ns-resolution time stamps. Don't assume time_t is signed.
4811
4812 2012-06-22 Chong Yidong <cyd@gnu.org>
4813
4814 * xdisp.c (x_consider_frame_title): Revert last change.
4815
4816 2012-06-22 Eli Zaretskii <eliz@gnu.org>
4817
4818 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4819 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4820 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4821 staticidx goes up to 1597 out of 1600 = 0x640.)
4822
4823 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4824
4825 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4826 Otherwise, the umask might be mistakenly 0 while handling input signals.
4827
4828 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4829
4830 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4831
4832 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4833
4834 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4835 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4836 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4837 access to `contents' member of Lisp_Vector objects with AREF and ASET
4838 where appropriate.
4839
4840 2012-06-19 Chong Yidong <cyd@gnu.org>
4841
4842 * frame.c (delete_frame): When selecting a frame on a different
4843 text terminal, do not alter the terminal's top-frame.
4844
4845 * xdisp.c (format_mode_line_unwind_data): Record the target
4846 frame's selected window and its terminal's top-frame.
4847 (unwind_format_mode_line): Restore them.
4848 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4849 Callers changed.
4850 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4851 since tty frames can be explicitly named.
4852 (prepare_menu_bars): Likewise.
4853
4854 * term.c (Ftty_top_frame): New function.
4855
4856 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4857
4858 Port byte-code-meter to modern targets.
4859 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4860 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
4861 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
4862 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4863 (METER_1, METER_2): Simplify.
4864
4865 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4866
4867 * data.c (Fdefalias): Return `symbol' (bug#11686).
4868
4869 2012-06-18 Martin Rudalics <rudalics@gmx.at>
4870
4871 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4872 gets killed during executing of this function (Bug#11665).
4873 Try to always return Qt when the buffer has been actually killed.
4874 (Vkill_buffer_query_functions): In doc-string say that functions
4875 run by this hook should not change the current buffer.
4876
4877 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 Fix recently-introduced process.c problems found by static checking.
4880 * process.c (write_queue_push, write_queue_pop, send_process):
4881 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4882 (write_queue_pop): Fix pointer signedness problem.
4883 (send_process): Remove unused local.
4884
4885 2012-06-17 Chong Yidong <cyd@gnu.org>
4886
4887 * xdisp.c (redisplay_internal): No need to redisplay terminal
4888 frames that are not on top.
4889
4890 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
4891
4892 * process.c (make_process): Initialize write_queue.
4893 (write_queue_push, write_queue_pop): New functions.
4894 (send_process): Use them to maintain correct ordering of process
4895 writes (Bug#10815).
4896
4897 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4898
4899 * lisp.h (eassert): Assume C89 or later.
4900 This removes the need for CHECK.
4901 (CHECK): Remove. Its comments about always evaluating its
4902 argument were confusing, as 'eassert' typically does not evaluate
4903 its argument.
4904
4905 * coding.c (produce_chars): Use ptrdiff_t, not int.
4906
4907 * xterm.c (x_draw_underwave): Check for integer overflow.
4908 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4909
4910 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
4911
4912 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4913 referenced (Bug#11583).
4914
4915 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4916
4917 Implement wave-style variant of underlining.
4918 * dispextern.h (face_underline_type): New enum.
4919 (face): Add field for underline type.
4920 * nsterm.m (ns_draw_underwave): New function.
4921 (ns_draw_text_decoration): Use it.
4922 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4923 New functions.
4924 (x_draw_glyph_string): Use them.
4925 * xfaces.c (Qline, Qwave): New Lisp objects.
4926 (check_lface_attrs, merge_face_ref)
4927 (Finternal_set_lisp_face_attribute, realize_x_face):
4928 Handle wave-style underline face attributes.
4929 * xterm.c (x_draw_underwave): New function.
4930 (x_draw_glyph_string): Use it.
4931
4932 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
4933
4934 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4935 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4936 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4937 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4938 ($(BLD)/w32select.$(O)): Update dependencies.
4939
4940 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4941
4942 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4943 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4944 * character.c (_fetch_multibyte_char_p): Remove.
4945 * alloc.c: Include "character.h" before "buffer.h".
4946 * bidi.c: Likewise.
4947 * buffer.c: Likewise.
4948 * bytecode.c: Likewise.
4949 * callint.c: Likewise.
4950 * callproc.c: Likewise.
4951 * casefiddle.c: Likewise.
4952 * casetab.c: Likewise.
4953 * category.c: Likewise.
4954 * cmds.c: Likewise.
4955 * coding.c: Likewise.
4956 * composite.c: Likewise.
4957 * dired.c: Likewise.
4958 * dispnew.c: Likewise.
4959 * doc.c: Likewise.
4960 * dosfns.c: Likewise.
4961 * editfns.c: Likewise.
4962 * emacs.c: Likewise.
4963 * fileio.c: Likewise.
4964 * filelock.c: Likewise.
4965 * font.c: Likewise.
4966 * fontset.c: Likewise.
4967 * fringe.c: Likewise.
4968 * indent.c: Likewise.
4969 * insdel.c: Likewise.
4970 * intervals.c: Likewise.
4971 * keyboard.c: Likewise.
4972 * keymap.c: Likewise.
4973 * lread.c: Likewise.
4974 * macros.c: Likewise.
4975 * marker.c: Likewise.
4976 * minibuf.c: Likewise.
4977 * nsfns.m: Likewise.
4978 * nsmenu.m: Likewise.
4979 * print.c: Likewise.
4980 * process.c: Likewise.
4981 * regex.c: Likewise.
4982 * region-cache.c: Likewise.
4983 * search.c: Likewise.
4984 * syntax.c: Likewise.
4985 * term.c: Likewise.
4986 * textprop.c: Likewise.
4987 * undo.c: Likewise.
4988 * unexsol.c: Likewise.
4989 * w16select.c: Likewise.
4990 * w32fns.c: Likewise.
4991 * w32menu.c: Likewise.
4992 * window.c: Likewise.
4993 * xdisp.c: Likewise.
4994 * xfns.c: Likewise.
4995 * xmenu.c: Likewise.
4996 * xml.c: Likewise.
4997 * xselect.c: Likewise.
4998
4999 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5000
5001 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5002 If all the glyphs of the glyph row came from strings, and we have no
5003 cursor positioning clues, put the cursor on the first glyph of the
5004 row.
5005 (handle_face_prop): Use chunk-relative overlay string index when
5006 indexing into it->string_overlays array. (Bug#11653)
5007 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5008 the rightmost. (Bug#11720)
5009
5010 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5011
5012 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5013 (CATEGORY_MEMBER): Enforce 1/0 value.
5014 * category.c (_temp_category_set): Remove.
5015
5016 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5017
5018 * window.c (Fdelete_other_windows_internal)
5019 (Fdelete_window_internal): Don't access frame's mouse highlight
5020 info of the initial frame. (Bug#11677)
5021
5022 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5023
5024 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5025 Assume USE_2_TAGS_FOR_INTS.
5026 (xreload): Adjust $tagmask width to match recent lisp.h change.
5027
5028 Simplify lisp.h in minor ways that should not affect code.
5029 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5030 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5031 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5032 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5033 (INTTYPEBITS): New macro, for clarity.
5034 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5035 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5036 Simplify now that USE_LSB_TAG is always defined.
5037 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5038 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5039
5040 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5041
5042 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5043
5044 2012-06-13 Glenn Morris <rgm@gnu.org>
5045
5046 * s/bsd-common.h (BSD4_3):
5047 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5048
5049 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5050
5051 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5052 instead of union.
5053 (XLI, XIL): Define.
5054 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5055 Use them.
5056 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5057 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5058 * alloc.c (widen_to_Lisp_Object): Remove.
5059 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5060 * frame.c (delete_frame): Remove outdated comment.
5061 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5062 USE_LISP_UNION_TYPE.
5063 (Fw32_unregister_hot_key): Likewise.
5064 (Fw32_toggle_lock_key): Likewise.
5065 * w32menu.c (add_menu_item): Likewise.
5066 (w32_menu_display_help): Use XIL instead of checking
5067 USE_LISP_UNION_TYPE.
5068 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5069 (init_heap): Likewise.
5070 * w32term.c (w32_read_socket): Update comment.
5071
5072 2012-06-13 Glenn Morris <rgm@gnu.org>
5073
5074 * s/usg5-4-common.h, src/s/unixware.h:
5075 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5076
5077 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5078
5079 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5080
5081 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5082 * alloc.c (make_number) [!defined make_number]:
5083 Remove, as lisp.h always defines this now.
5084 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5085 (roundup_size): Verify that it is a power of 2.
5086 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5087 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5088 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5089 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5090 USE_LSB_TAG now is always defined to be either 0 or 1.
5091 All uses changed.
5092 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5093 code works fine either way, and efficiency is not a concern here,
5094 as the union type is for debugging, not for production.
5095 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5096 Use an inline function on all platforms when using the union type,
5097 since this is simpler and 'static inline' can be used portably
5098 within Emacs now.
5099 (LISP_INITIALLY_ZERO): New macro.
5100 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5101 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5102
5103 2012-06-12 Glenn Morris <rgm@gnu.org>
5104
5105 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5106
5107 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5108
5109 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5110 Move BROKEN_SIGIO to configure.
5111
5112 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5113 Move NO_TERMIO to configure.
5114
5115 2012-06-12 Chong Yidong <cyd@gnu.org>
5116
5117 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5118 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5119 MagickExportImagePixels is undefined.
5120
5121 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5122
5123 * image.c (imagemagick_load_image): Remove unused label.
5124
5125 2012-06-11 Glenn Morris <rgm@gnu.org>
5126
5127 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5128 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5129 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5130 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5131
5132 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5133
5134 * alloc.c (make_byte_code): New function.
5135 (Fmake_byte_code): Use it. Don't purify here.
5136 * lread.c (read1): Use it as well to avoid extra allocation.
5137
5138 2012-06-11 Chong Yidong <cyd@gnu.org>
5139
5140 * image.c (imagemagick_load_image): Implement transparency.
5141
5142 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5143
5144 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5145 account for preceding backslashes. (Bug#11663)
5146
5147 2012-06-09 Chong Yidong <cyd@gnu.org>
5148
5149 * term.c: Support italics in capable terminals (Bug#9652).
5150 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5151 (turn_on_face): Output using TS_enter_italic_mode if available.
5152 Don't handle unused blinking and alt-charset cases.
5153 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5154 and tty_alt_charset_p cases.
5155 (tty_capable_p, init_tty): Support italics.
5156
5157 * termchar.h (struct tty_display_info): Add field for italics.
5158 Remove unused blink field.
5159
5160 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5161 Handle slant.
5162
5163 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5164 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5165 tty_alt_charset_p. Add tty_italic_p.
5166
5167 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5168
5169 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5170 dbus_type_is_basic if available.
5171 (xd_extract_signed, xd_extract_unsigned): Rename from
5172 extract_signed and extract_unsigned, respectively. Adapt callers.
5173
5174 2012-06-09 Chong Yidong <cyd@gnu.org>
5175
5176 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5177
5178 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5179 case (Bug#9752).
5180
5181 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5182
5183 * xdisp.c (vmessage): Treat frame message as multibyte.
5184 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5185 would generate the diagnostic "Making \302\247 buffer-local while
5186 let-bound!".
5187
5188 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5189
5190 * dispnew.c (showing_window_margins_p): Undo last change, which
5191 was done due to an inadvertent commit.
5192 (adjust_frame_glyphs_for_frame_redisplay): Do call
5193 showing_window_margins_p.
5194
5195 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5196
5197 * eval.c (Fmake_var_non_special): New primitive.
5198 (syms_of_eval): Defsubr it.
5199 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5200
5201 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5202
5203 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5204 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5205
5206 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5207
5208 * alloc.c (allocate_vectorlike): Fix last change.
5209
5210 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5211
5212 Block-based vector allocation of small vectors.
5213 * lisp.h (struct vectorlike_header): New field `nbytes',
5214 adjust comment accordingly.
5215 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5216 to denote vector blocks. Adjust users (live_vector_p,
5217 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5218 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5219 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5220 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5221 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5222 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5223 (roundup_size): New constant.
5224 (struct vector_block): New data type.
5225 (vector_blocks, vector_free_lists, zero_vector): New variables.
5226 (all_vectors): Rename to `large_vectors'.
5227 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5228 (sweep_vectors): New functions.
5229 (allocate_vectorlike): Return `zero_vector' as the only vector of
5230 0 items. Allocate new vector from block if vector size is less than
5231 or equal to VBLOCK_BYTES_MAX.
5232 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5233 (init_alloc_once): Add call to init_vectors.
5234
5235 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5236
5237 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5238
5239 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5240
5241 * doprnt.c (doprnt): Truncate multibyte char correctly.
5242 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5243 would mishandle a string argument "Xc" if X was a multibyte
5244 character of length 2: it would truncate after X's first byte
5245 rather than including all of X.
5246
5247 2012-06-06 Chong Yidong <cyd@gnu.org>
5248
5249 * buffer.c (word_wrap): Doc fix.
5250
5251 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5252
5253 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5254
5255 2012-06-03 Glenn Morris <rgm@gnu.org>
5256
5257 * xdisp.c (tool-bar-style): Doc fix.
5258
5259 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5260
5261 * Makefile.in (PAXCTL): Define.
5262 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5263 binary via PaX flags if the paxctl utility is available.
5264 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5265 Restore PaX flags to their default. (Bug#11398)
5266
5267 2012-06-03 Chong Yidong <cyd@gnu.org>
5268
5269 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5270 buffer (Bug#11226).
5271
5272 2012-06-03 Chong Yidong <cyd@gnu.org>
5273
5274 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5275 (note_mode_line_or_margin_highlight): If there is no help echo,
5276 use mode-line-default-help-echo. Handle the case where the mouse
5277 position is past the end of the mode line string.
5278
5279 * buffer.c (buffer_local_value_1): New function, split from
5280 Fbuffer_local_value; can return Qunbound.
5281 (Fbuffer_local_value): Use it.
5282 (Vmode_line_format): Docstring tweaks.
5283
5284 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5285
5286 * sysdep.c (system_process_attributes): Improve comment.
5287
5288 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5289
5290 * keyboard.c: Export real-this-command to Elisp.
5291 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5292 and DEFVAR it. Update all users.
5293
5294 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5295
5296 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5297
5298 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5299 Convert pctcpu and pctmem to Lisp float properly.
5300 Let the compiler fold better, as 100.0/0x8000 is exact.
5301
5302 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5303
5304 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5305 cons_block.
5306
5307 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5308
5309 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5310
5311 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5312
5313 For a 'struct window', replace some Lisp_Object fields to
5314 bitfields where appropriate, remove unused fields.
5315 * window.h (struct window): Remove unused 'last_mark_x' and
5316 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5317 change it's type from Lisp_Object to bitfield.
5318 Change type of 'force_start', 'optional_new_start',
5319 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5320 fields from Lisp_Object to bitfield. Adjust users accordingly.
5321
5322 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5323
5324 Pacify gcc -Wdouble-precision when using Xaw.
5325 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5326 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5327 Use 'float' consistently, rather than 'float' in most places
5328 and 'double' in a couple of places.
5329
5330 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5331
5332 * xdisp.c (handle_stop): Detect whether we have overlay strings
5333 loaded by testing it->current.overlay_string_index to be
5334 non-negative, instead of checking whether n_overlay_strings is
5335 positive. (Bug#11587)
5336
5337 2012-05-31 Chong Yidong <cyd@gnu.org>
5338
5339 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5340
5341 * doc.c (Fsubstitute_command_keys): Doc fix.
5342
5343 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5344
5345 * search.c (search_buffer): Remove calls to
5346 r_alloc_inhibit_buffer_relocation, as it is now called by
5347 maybe_unify_char, which was the cause of relocation of buffer text
5348 in bug#11519.
5349
5350 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5351
5352 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5353 for the duration of call to load_charset, to avoid problems with
5354 callers of maybe_unify_char that access buffer text through C
5355 pointers.
5356
5357 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5358 decrement the inhibition flag, instead of just setting or
5359 resetting it.
5360
5361 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5362
5363 Remove obsolete '#define static' cruft.
5364 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5365 This #undef was "temporary" in 2000; it is no longer needed
5366 now that '#define static' has gone away.
5367 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5368 (gray_bitmap_bits): Remove; no longer needed.
5369 All uses replaced with definiens.
5370 * xterm.c: Include "bitmaps/gray.xbm".
5371
5372 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5373
5374 Clean up __executable_start, monstartup when --enable-profiling.
5375 The following changes affect the code only when profiling.
5376 * dispnew.c (__executable_start): Rename from safe_bcopy.
5377 Define only on platforms that need it.
5378 * emacs.c: Include <sys/gmon.h> when profiling.
5379 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5380 (__executable_start): Remove decl, since lisp.h does it now.
5381 (safe_bcopy): Remove decl; no longer has that name.
5382 (main): Coalesce #if into single bit of code, for simplicity.
5383 Cast pointers to uintptr_t, since standard libraries want integers
5384 and not pointers.
5385 * lisp.h (__executable_start): New decl.
5386
5387 2012-05-31 Glenn Morris <rgm@gnu.org>
5388
5389 * image.c (Fimagemagick_types): Doc fix.
5390
5391 2012-05-30 Jim Meyering <meyering@redhat.com>
5392
5393 * callproc.c (Fcall_process_region): Include directory component
5394 in mkstemp error message (Bug#11586).
5395
5396 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5397
5398 * alloc.c, lisp.h (make_pure_vector): Now static.
5399
5400 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5401
5402 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5403 Move to byte-run.el.
5404 (Fautoload): Do the hash-doc more carefully.
5405 * data.c (Fdefalias): Purify definition, except for keymaps.
5406 (Qdefun): Move from eval.c.
5407 * lisp.h (Qdefun): Remove.
5408 * lread.c (read1): Tiny simplification.
5409
5410 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
5411
5412 Do not create empty overlays with the evaporate property (Bug#9642).
5413 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5414 Bug#9642, but explicitly check that the buffer the overlay would
5415 be moved to is live and rearrange lines to make sure that errors
5416 will not put the overlay in an inconsistent state.
5417 (Fdelete_overlay): Cosmetics.
5418
5419 2012-05-28 Eli Zaretskii <eliz@gnu.org>
5420
5421 * w32term.c (my_bring_window_to_top): New function.
5422 (x_raise_frame): Use handle returned by DeferWindowPos, which
5423 could be different from the original one.
5424 Call my_bring_window_to_top instead of my_set_foreground_window.
5425 (Bug#11513)
5426
5427 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5428 by calling BringWindowToTop.
5429
5430 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5431 (WM_EMACS_END): Increase by one.
5432
5433 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5434
5435 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5436 This avoids undefined behavior that might cause the eassert
5437 to not catch an out-of-range value.
5438
5439 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
5440
5441 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5442 Update dependencies.
5443
5444 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5445
5446 * bidi.c (bidi_mirror_char): Fix last change.
5447
5448 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5449
5450 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5451 when referring to sectname field in printf format.
5452
5453 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5454
5455 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5456 Only r_alloc_inhibit_buffer_relocation needed to be added;
5457 the others were already declared.
5458
5459 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5460 before checking whether it's out of range. Put the check inside
5461 eassert. See
5462 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5463
5464 2012-05-27 Ken Brown <kbrown@cornell.edu>
5465
5466 * callproc.c (Fcall_process): Restore a line that was accidentally
5467 commented out in the 2011-02-13 change (bug#11547).
5468
5469 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5470
5471 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5472 defined on ralloc.c.
5473
5474 * buffer.c [REL_ALLOC]: Remove prototypes of
5475 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5476 they are now on lisp.h.
5477
5478 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5479
5480 * search.c (search_buffer): Use it to inhibit relocation of buffer
5481 text while re_search_2 is doing its job, because re_search_2 is
5482 passed C pointers to buffer text. (Bug#11519)
5483
5484 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5485 Update value to 24.
5486
5487 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5488 state after an additional call to move_it_in_display_line_to, keep
5489 the values of it->max_ascent and it->max_descent found for the
5490 entire line.
5491 (pos_visible_p): Revert the comparison against bottom_y to what it
5492 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5493 (Bug#11464)
5494
5495 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5496
5497 Fix coding-related core dumps with gcc -ftrapv.
5498 The code was computing A - B, where A and B are pointers, and B is
5499 random garbage. This can lead to core dumps on platforms that
5500 have special pointer registers, and it also leads to core dumps on
5501 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5502 A - B only when B is initialized properly.
5503 * coding.c (coding_set_source, coding_set_destination): Return void.
5504 (coding_change_source, coding_change_destinations): New functions,
5505 with the old behaviors of coding_set_source and coding_set_destination.
5506 All callers that need an offset changed to use these new functions.
5507
5508 2012-05-26 Glenn Morris <rgm@gnu.org>
5509
5510 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5511
5512 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5513
5514 Extend mouse support on W32 text-mode console.
5515 * xdisp.c (draw_row_with_mouse_face):
5516 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
5517
5518 * w32console.c: Include window.h.
5519 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5520 New functions.
5521 (initialize_w32_display): Initialize mouse-highlight data.
5522
5523 * w32inevt.c: Include termchar.h and window.h.
5524 (do_mouse_event): Support mouse-autoselect-window. When the mouse
5525 moves, call note_mouse_highlight. If help_echo changed, call
5526 gen_help_event to produce help-echo message in the echo area.
5527 Call clear_mouse_face if mouse_face_hidden is set in the mouse
5528 highlight info.
5529
5530 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5531
5532 * lread.c (read1): Simplify slightly to avoid an overflow warning
5533 with GCC 4.7.0 on x86-64.
5534
5535 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5536
5537 * bidi.c (bidi_mirror_char): Revert last change: an int is
5538 definitely wide enough here.
5539
5540 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
5541
5542 Fix integer width and related bugs (Bug#9874).
5543 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
5544 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5545 (string_bytes, check_sblock, allocate_string_data):
5546 (compact_small_strings, Fmake_bool_vector, make_string)
5547 (make_unibyte_string, make_multibyte_string)
5548 (make_string_from_bytes, make_specified_string)
5549 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5550 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5551 (mark_vectorlike):
5552 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5553 (allocate_pseudovector):
5554 Use int, not EMACS_INT, where int is wide enough.
5555 (inhibit_garbage_collection, Fgarbage_collect):
5556 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5557 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5558 int might not be wide enough.
5559 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5560 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5561 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5562 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5563 (bidi_level_of_next_char, bidi_move_to_visually_next):
5564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5565 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5566 (Fkill_buffer, Fset_buffer_major_mode)
5567 (advance_to_char_boundary, Fbuffer_swap_text)
5568 (Fset_buffer_multibyte, overlays_at, overlays_in)
5569 (overlay_touches_p, struct sortvec, record_overlay_string)
5570 (overlay_strings, recenter_overlay_lists)
5571 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5572 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5573 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5574 (Foverlay_recenter, last_overlay_modification_hooks_used)
5575 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5577 (validate_region): Omit unnecessary test for b <= e,
5578 since that's guaranteed by the previous test.
5579 (adjust_overlays_for_delete): Avoid pos + length overflow.
5580 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5581 (report_overlay_modification):
5582 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5583 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5584 Omit pointer cast, which isn't needed anyway, and doesn't work
5585 after the EMACS_INT -> ptrdiff_t change.
5586 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
5587 * buffer.h: Adjust decls to match defn changes elsewhere.
5588 (struct buffer_text, struct buffer):
5589 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5590 Use EMACS_INT, not int, where int might not be wide enough.
5591 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5592 not int, to avoid needless 32-bit limit on 64-bit hosts.
5593 (exec_byte_code): Use tighter memory-full test, one that checks
5594 for alloca overflow. Don't compute the address of the object just
5595 before an array, as that's not portable. Use EMACS_INT, not
5596 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
5597 * callint.c (Fcall_interactively):
5598 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5599 * callproc.c (call_process_kill, Fcall_process):
5600 Don't assume pid_t fits into an Emacs fixnum.
5601 (call_process_cleanup, Fcall_process, child_setup):
5602 Don't assume pid_t fits into int.
5603 (call_process_cleanup, Fcall_process, delete_temp_file)
5604 (Fcall_process_region):
5605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5606 (Fcall_process): Simplify handling of volatile integers.
5607 Use int, not EMACS_INT, where int will do.
5608 * casefiddle.c (casify_object, casify_region, operate_on_word)
5609 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5610 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5611 (casify_object): Avoid integer overflow when overallocating buffer.
5612 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
5613 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
5614 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5615 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5616 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5617 integers are now checked earlier. All uses replaced with XINT.
5618 (ccl_driver):
5619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5620 For CCL_MapSingle, check that content and value are in int range.
5621 (ccl_driver, Fregister_code_conversion_map):
5622 Check that Vcode_version_map_vector is a vector.
5623 (resolve_symbol_ccl_program): Check that vector header is in range.
5624 Always copy the vector, so that we can check its contents reliably
5625 now rather than having to recheck each instruction as it's being
5626 executed. Check that vector words fit in 'int'.
5627 (ccl_get_compiled_code, Fregister_ccl_program)
5628 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5629 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5630 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5631 contents are in range.
5632 (Fccl_execute_on_string): Check that status is in range.
5633 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5634 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5635 Accept and return EMACS_INT, not int, because callers can pass values
5636 out of 'int' range.
5637 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5638 (multibyte_chars_in_text, parse_str_as_multibyte)
5639 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5640 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5641 (string_escape_byte8, Fget_byte):
5642 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5643 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
5644 avoid mishandling large integers.
5645 * character.h: Adjust decls to match defn changes elsewhere.
5646 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5647 (Ffind_charset_region):
5648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5649 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5650 (load_charset_map_from_vector, Fdefine_charset_internal):
5651 Don't assume fixnum fits in int.
5652 (load_charset_map_from_vector, Fmap_charset_chars):
5653 Remove now-unnecessary CHECK_NATNUMs.
5654 (Fdefine_charset_internal): Check ranges here, more carefully.
5655 Don't rely on undefined behavior with signed left shift overflow.
5656 Don't assume unsigned int fits into fixnum, or that fixnum fits
5657 into unsigned int. Don't require max_code to be a valid fixnum;
5658 that's not true for gb10830 4-byte on a 32-bit host. Allow
5659 invalid_code to be a cons, for the same reason. Require code_offset
5660 to be a character. Avoid int overflow if max_char is close
5661 to INT_MAX.
5662 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5663 this is intended anyway and avoids some undefined behavior.
5664 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5665 INDEX_TO_CODE_POINT, as that's what it expects.
5666 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
5667 * charset.h (DECODE_CHAR): Return int, not unsigned;
5668 this is what was intended anyway, and it avoids undefined behavior.
5669 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5670 integer-overflow issues.
5671 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5672 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5673 where the argument is EMACS_INT, and this behavior is not intended.
5674 * chartab.c (Fmake_char_table, Fset_char_table_range)
5675 (uniprop_get_decoder, uniprop_get_encoder):
5676 Don't assume fixnum fits in int.
5677 * cmds.c (move_point): New function, that does the gist of
5678 Fforward_char and Fbackward_char, but does so while checking
5679 for integer overflow more accurately.
5680 (Fforward_char, Fbackward_char): Use it.
5681 (Fforward_line, Fend_of_line, internal_self_insert)
5682 (internal_self_insert):
5683 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5684 Fix a FIXME, by checking for integer overflow when calculating
5685 target_clm and actual_clm.
5686 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
5687 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
5688 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5689 (coding_alloc_by_making_gap, alloc_destination)
5690 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5691 (encode_coding_utf_16, detect_coding_emacs_mule)
5692 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5693 (detect_coding_iso_2022, decode_coding_iso_2022)
5694 (encode_invocation_designation, encode_designation_at_bol)
5695 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5696 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5697 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5698 (encode_coding_ccl, encode_coding_raw_text)
5699 (detect_coding_charset, decode_coding_charset)
5700 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5701 (produce_composition, produce_charset, produce_annotation)
5702 (decode_coding, handle_composition_annotation)
5703 (handle_charset_annotation, consume_chars, decode_coding_gap)
5704 (decode_coding_object, encode_coding_object, detect_coding_system)
5705 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5706 (code_convert_region, code_convert_string)
5707 (Fdefine_coding_system_internal)
5708 (coding_set_source, coding_set_destination):
5709 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5710 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5711 (Fdefine_coding_system_internal):
5712 Don't assume fixnums fit in int.
5713 (decode_coding_gap, decode_coding_object, encode_coding_object)
5714 (Fread_coding_system, Fdetect_coding_region)
5715 (Funencodable_char_position, Fcheck_coding_systems_region)
5716 (get_translation, handle_composition_annotation, consume_chars):
5717 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5718 (consume_chars): Rewrite to not calculate an address outside buffer.
5719 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
5720 Don't access memory outside of the args array.
5721 (Fdefine_coding_system_internal): Check for charset-id overflow.
5722 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5723 result of ENCODE_CHAR.
5724 * coding.h: Adjust decls to match defn changes elsewhere.
5725 (struct coding_system):
5726 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5727 * composite.c (get_composition_id, find_composition)
5728 (run_composition_function, update_compositions)
5729 (compose_text, composition_gstring_put_cache)
5730 (composition_gstring_p, composition_gstring_width)
5731 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5732 (composition_compute_stop_pos, composition_reseat_it)
5733 (composition_update_it, struct position_record)
5734 (find_automatic_composition, composition_adjust_point)
5735 (Fcomposition_get_gstring, Ffind_composition_internal):
5736 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5737 (update_compositions):
5738 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5739 * composite.h: Adjust decls to match defn changes elsewhere.
5740 (struct composition):
5741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5742 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5743 Do not attempt to compute the address of the object just before a
5744 buffer; this is not portable.
5745 (Faref, Faset):
5746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5747 (Faset): Use int, not EMACS_INT, where int is wide enough.
5748 (Fstring_to_number): Don't assume fixnums fit in int.
5749 (Frem): Don't assume arg is nonnegative.
5750 * dbusbind.c (xd_append_arg): Check for integers out of range.
5751 (Fdbus_call_method): Don't overflow the timeout int.
5752 (extract_signed, extract_unsigned): New functions.
5753 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5754 (xd_get_connection_references): Return ptrdiff_t, not int.
5755 All uses changed.
5756 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5757 (xd_read_message_1):
5758 Use int, not unsigned, where the dbus API uses int.
5759 (Fdbus_message_internal): Don't overflow mtype.
5760 (syms_of_dbusbind): Allocate right-sized buffer for integers.
5761 * dired.c (directory_files_internal, file_name_completion, scmp)
5762 (file_name_completion_stat):
5763 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5764 (file_name_completion): Don't overflow matchcount.
5765 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5766 * dispextern.h: Adjust decls to match defn changes elsewhere.
5767 (struct text_pos, struct glyph, struct bidi_saved_info)
5768 (struct bidi_string_data, struct bidi_it, struct composition_it)
5769 (struct it):
5770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5771 (struct display_pos, struct composition_it, struct it):
5772 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5773 * dispnew.c (increment_matrix_positions)
5774 (increment_row_positions, mode_line_string)
5775 (marginal_area_string):
5776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5777 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
5778 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5779 (duration_to_sec_usec): New function, to check for overflow better.
5780 (Fsleep_for, sit_for): Use it.
5781 * doc.c (get_doc_string, store_function_docstring):
5782 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5783 (get_doc_string, Fsnarf_documentation):
5784 Use int, not EMACS_INT, where int is wide enough.
5785 (get_doc_string):
5786 Use SAFE_ALLOCA, not alloca.
5787 Check for overflow when converting EMACS_INT to off_t.
5788 * doprnt.c (doprnt):
5789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5790 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5791 Don't assume uid_t fits into fixnum.
5792 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5793 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5794 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5795 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5796 (general_insert_function)
5797 (Finsert_char, make_buffer_string, make_buffer_string_both)
5798 (update_buffer_properties, Fbuffer_substring)
5799 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5800 (Fsubst_char_in_region, check_translation)
5801 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5802 (transpose_markers, Ftranspose_regions):
5803 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5804 (clip_to_bounds): Move to lisp.h as an inline function).
5805 (Fconstrain_to_field): Don't assume integers are nonnegative.
5806 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5807 (Fsubst_char_in_region, Fsave_restriction):
5808 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5809 (Femacs_pid): Don't assume pid_t fits into fixnum.
5810 (lo_time): Use int, not EMACS_INT, when int suffices.
5811 (lisp_time_argument): Check for usec out of range.
5812 (Fencode_time): Don't assume fixnum fits in int.
5813 (Fuser_login_name, Fuser_full_name): Signal an error
5814 if a uid argument is out of range, rather than relying on
5815 undefined behavior.
5816 (Fformat_time_string): Remove now-unnecessary check.
5817 lisp_time_argument checks for out-of-range usec now.
5818 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
5819 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5820 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5821 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5822 (init_cmdargs, Fdump_emacs):
5823 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5824 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5825 the bottom (typically) 32 bits of the fixnum.
5826 * eval.c (specpdl_size, call_debugger):
5827 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5828 (when_entered_debugger, Fbacktrace_debug):
5829 Don't assume fixnum can fit in int.
5830 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5831 the object just before a buffer; this is not portable.
5832 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5833 (grow_specpdl, unbind_to):
5834 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5835 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5836 (grow_specpdl): Simplify allocation by using xpalloc.
5837 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
5838 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5839 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5841 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5842 (a_write, e_write):
5843 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5844 (Fcopy_file, non_regular_nbytes, read_non_regular)
5845 (Finsert_file_contents):
5846 Use int, not EMACS_INT, where int is wide enough.
5847 (READ_BUF_SIZE): Verify that it fits in int.
5848 (Finsert_file_contents): Check that counts are in proper range,
5849 rather than assuming fixnums fit into ptrdiff_t etc.
5850 Don't assume fixnums fit into int.
5851 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5852 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5853 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
5854 (string_char_to_byte, string_byte_to_char)
5855 (string_make_multibyte, string_to_multibyte)
5856 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5857 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5858 (substring_both, Fdelete, internal_equal, Ffillarray)
5859 (Fclear_string, mapcar1)
5860 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5861 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5862 (larger_vector, make_hash_table, maybe_resize_hash_table)
5863 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5864 (Fmaphash, secure_hash):
5865 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5866 (concat): Check for string index and length overflow.
5867 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5868 (Frequire):
5869 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5870 (larger_vector): New API (vec, incr_min, size_max) replaces old
5871 one (vec, new_size, init). This catches size overflow.
5872 INIT was removed because it was always Qnil.
5873 All callers changed.
5874 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5875 the upper bound on a hash table index size.
5876 (make_hash_table, maybe_resize_hash_table): Use it.
5877 (secure_hash): Computer start_byte and end_byte only after
5878 they're known to be in ptrdiff_t range.
5879 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5880 (Ffont_get_glyphs, Ffont_at):
5881 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5882 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5883 (Flist_fonts, Fopen_font):
5884 Don't assume fixnum can fit in int.
5885 (check_gstring): Don't assume index can fit in int.
5886 (font_match_p): Check that fixnum is a character, not a nonnegative
5887 fixnum, since the later code needs to stuff it into an int.
5888 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5889 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5890 conversion overflow issues.
5891 (Fopen_font): Check for integer out of range.
5892 (Ffont_get_glyphs): Don't assume index can fit in int.
5893 * font.h: Adjust decls to match defn changes elsewhere.
5894 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5895 integer overflow.
5896 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5897 printmax_t, where ptrdiff_t is wide enough.
5898 (Finternal_char_font):
5899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5900 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5901 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5902 (Fset_frame_position, x_set_frame_parameters)
5903 (x_set_line_spacing, x_set_border_width)
5904 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5905 Check that fixnums are in proper range for system types.
5906 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5907 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5908 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5909 Use SAFE_ALLOCA_LISP, not alloca.
5910 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5911 intptr_t is wide enough.
5912 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5913 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5914 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5915 Check for fixnum out of range.
5916 * ftfont.c (ftfont_list): Don't assume index fits in int.
5917 Check that fixnums are in proper range for system types.
5918 (ftfont_shape_by_flt):
5919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5920 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5922 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5923 Check that fixnums are in proper range for system types.
5924 * gnutls.h: Adjust decls to match defn changes elsewhere.
5925 * gtkutil.c (xg_dialog_run):
5926 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5927 (update_frame_tool_bar):
5928 Check that fixnums are in proper range for system types.
5929 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5930 (lookup_image): Check that fixnums are in range for system types.
5931 * indent.c (last_known_column, last_known_column_point):
5932 (current_column_bol_cache):
5933 (skip_invisible, current_column, check_display_width):
5934 (check_display_width, scan_for_column, current_column_1)
5935 (Findent_to, Fcurrent_indentation, position_indentation)
5936 (indented_beyond_p, Fmove_to_column, compute_motion):
5937 (Fcompute_motion, Fvertical_motion):
5938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5939 (last_known_column_modified): Use EMACS_INT, not int.
5940 (check_display_width):
5941 (Fcompute_motion):
5942 Check that fixnums and floats are in proper range for system types.
5943 (compute_motion): Don't assume index or fixnum fits in int.
5944 (compute_motion, Fcompute_motion):
5945 Use int, not EMACS_INT, when it is wide enough.
5946 (vmotion): Omit local var start_hpos that is always 0; that way
5947 we don't need to worry about overflow in expressions involving it.
5948 * indent.h: Adjust decls to match defn changes elsewhere.
5949 (struct position):
5950 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5951 Use int, not EMACS_INT, where int is wide enough.
5952 Remove unused members ovstring_chars_done and tab_offset;
5953 all uses removed.
5954 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5955 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5956 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5957 (make_gap, copy_text, insert, insert_and_inherit)
5958 (insert_before_markers, insert_before_markers_and_inherit)
5959 (insert_1, count_combining_before, count_combining_after)
5960 (insert_1_both, insert_from_string)
5961 (insert_from_string_before_markers, insert_from_string_1)
5962 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5963 (adjust_after_replace, adjust_after_insert, replace_range)
5964 (replace_range_2, del_range, del_range_1, del_range_byte)
5965 (del_range_both, del_range_2, modify_region)
5966 (prepare_to_modify_buffer, signal_before_change)
5967 (signal_after_change, Fcombine_after_change_execute):
5968 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5969 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5970 (balance_an_interval, split_interval_right, split_interval_left)
5971 (find_interval, next_interval, update_interval)
5972 (adjust_intervals_for_insertion, delete_node, delete_interval)
5973 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5974 (static_offset_intervals, offset_intervals)
5975 (merge_interval_right, merge_interval_left, make_new_interval)
5976 (graft_intervals_into_buffer, temp_set_point_both)
5977 (temp_set_point, set_point, adjust_for_invis_intang)
5978 (set_point_both, move_if_not_intangible, get_property_and_range)
5979 (get_local_map, copy_intervals, copy_intervals_to_string)
5980 (compare_string_intervals, set_intervals_multibyte_1):
5981 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5982 * intervals.h: Adjust decls to match defn changes elsewhere.
5983 (struct interval):
5984 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5985 * keyboard.c (this_command_key_count, this_single_command_key_start)
5986 (before_command_key_count, before_command_echo_length, echo_now)
5987 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5988 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5989 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5990 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5992 (last_non_minibuf_size, last_point_position, echo_truncate)
5993 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5994 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5995 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5996 (stuff_buffered_input):
5997 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5998 (last_auto_save, command_loop_1, read_char):
5999 Use EMACS_INT, not int, to avoid integer overflow.
6000 (record_char): Avoid overflow in total_keys computation.
6001 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6002 * keyboard.h: Adjust decls to match defn changes elsewhere.
6003 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6004 (Fkey_description, Fdescribe_vector, Flookup_key):
6005 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6006 (click_position): New function, to check that positions are in range.
6007 (Fcurrent_active_maps):
6008 (describe_command):
6009 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6010 (Faccessible_keymaps, Fkey_description):
6011 (preferred_sequence_p):
6012 Don't assume fixnum can fit into int.
6013 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6014 Check for integer overflow in size calculations.
6015 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6016 avoid mishandling large integers.
6017 * lisp.h: Adjust decls to match defn changes elsewhere.
6018 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6019 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6020 (struct Lisp_Marker):
6021 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6022 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6023 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6024 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6025 All callers changed.
6026 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6027 Assume the arg has valid form, since it always does.
6028 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6029 unsigned integer system type.
6030 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6031 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6032 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6033 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6034 (duration_to_sec_usec): New decl.
6035 * lread.c (read_from_string_index, read_from_string_index_byte)
6036 (read_from_string_limit, readchar, unreadchar, openp)
6037 (read_internal_start, read1, oblookup):
6038 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6039 (Fload, readevalloop, Feval_buffer, Feval_region):
6040 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6041 (openp): Check for out-of-range argument to 'access'.
6042 (read1): Use int, not EMACS_INT, where int is wide enough.
6043 Don't assume fixnum fits into int.
6044 Fix off-by-one error that can read outside a buffer.
6045 (read_filtered_event): Use duration_to_sec_usec
6046 to do proper overflow checking on durations.
6047 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6048 in size calculation.
6049 (Fexecute_kbd_macro):
6050 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6051 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6052 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6053 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6054 (set_marker_both, set_marker_restricted_both, marker_position)
6055 (marker_byte_position, Fbuffer_has_markers_at):
6056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6057 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6058 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6059 It now merely ensures that the menu is large enough, without
6060 necessarily growing it, as this avoids some integer overflow issues.
6061 All callers changed.
6062 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6063 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6064 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6065 Use SAFE_ALLOCA_LISP, not alloca.
6066 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6067 to EMACS_INT. Check that fixnums are in proper range for system types.
6068 * minibuf.c (minibuf_prompt_width, string_to_object)
6069 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6070 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6071 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6072 (get_minibuffer, read_minibuf_unwind):
6073 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6074 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6075 this simplifies overflow checking. All callers changed.
6076 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6077 (Ftest_completion):
6078 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6079 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6080 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6081 Check that fixnums are in proper range for system types.
6082 (Fx_create_frame, Fx_show_tip):
6083 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6084 * nsfont.m (ns_findfonts, nsfont_list_family):
6085 Don't assume fixnum fits in long.
6086 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6087 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6088 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6089 wide enough.
6090 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6091 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6092 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6093 (PRINTDECLARE, PRINTPREPARE):
6094 (strout, print_string):
6095 (print, print_preprocess, print_check_string_charset_prop)
6096 (print_object):
6097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6098 (PRINTDECLARE):
6099 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6100 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6101 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6102 (printchar, strout): Use xpalloc to catch size calculation overflow.
6103 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6104 (print_error_message): Use SAFE_ALLOCA, not alloca.
6105 (print_object): Use int, not EMACS_INT, where int is wide enough.
6106 (print_depth, new_backquote_output, print_number_index):
6107 Use ptrdiff_t, not int, where int might not be wide enough.
6108 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6109 (Fset_process_window_size, Fformat_network_address)
6110 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6111 (sigchld_handler):
6112 Check that fixnums are in proper range for system types.
6113 (Fsignal_process): Simplify by avoiding a goto.
6114 Check for process-ids out of pid_t range rather than relying on
6115 undefined behavior.
6116 (process_tick, update_tick): Use EMACS_INT, not int.
6117 (Fformat_network_address, read_process_output, send_process)
6118 (Fprocess_send_region, status_notify):
6119 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6120 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6121 (wait_reading_process_output, read_process_output, exec_sentinel):
6122 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6123 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6124 (Faccept_process_output): Use duration_to_sec_usec to do proper
6125 overflow checking on durations.
6126 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6127 Don't assume pid_t fits in int.
6128 * process.h (struct Lisp_Process): Members tick and update_tick
6129 are now of type EMACS_INT, not int.
6130 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6131 configured --with-wide-int.
6132 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6133 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6134 * search.c (looking_at_1, string_match_1):
6135 (fast_string_match, fast_c_string_match_ignore_case)
6136 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6137 (scan_newline, find_before_next_newline, search_command)
6138 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6139 (set_search_regs, wordify):
6140 (Freplace_match):
6141 (Fmatch_data):
6142 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6143 (string_match_1, search_buffer, set_search_regs):
6144 (Fmatch_data):
6145 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6146 (wordify): Check for overflow in size calculation.
6147 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6148 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6149 Check that fixnums are in proper range for system types.
6150 * sound.c (struct sound_device)
6151 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6152 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6153 (Fplay_sound_internal):
6154 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6155 * syntax.c (struct lisp_parse_state, find_start_modiff)
6156 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6157 (Fparse_partial_sexp):
6158 Don't assume fixnums can fit in int.
6159 (struct lisp_parse_state, find_start_pos, find_start_value)
6160 (find_start_value_byte, find_start_begv)
6161 (update_syntax_table, char_quoted, dec_bytepos)
6162 (find_defun_start, prev_char_comend_first, back_comment):
6163 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6164 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6165 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6166 (Finternal_describe_syntax_value): Check that match_lisp is a
6167 character, not an integer, since the code stuffs it into int.
6168 (scan_words, scan_sexps_forward):
6169 Check that fixnums are in proper range for system types.
6170 (Fforward_word):
6171 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6172 (scan_sexps_forward):
6173 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6174 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6175 * syntax.h: Adjust decls to match defn changes elsewhere.
6176 (struct gl_state_s):
6177 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6178 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6179 MOST_POSITIVE_FIXNUM.
6180 * sysdep.c (wait_for_termination_1, wait_for_termination)
6181 (interruptible_wait_for_termination, mkdir):
6182 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6183 (emacs_read, emacs_write):
6184 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6185 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6186 and double all fit in int.
6187 * term.c (set_tty_color_mode):
6188 Check that fixnums are in proper range for system types.
6189 * termhooks.h (struct input_event):
6190 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6191 * textprop.c (validate_interval_range, interval_of)
6192 (Fadd_text_properties, set_text_properties_1)
6193 (Fremove_text_properties, Fremove_list_of_text_properties)
6194 (Ftext_property_any, Ftext_property_not_all)
6195 (copy_text_properties, text_property_list, extend_property_ranges)
6196 (verify_interval_modification):
6197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6198 (Fnext_single_char_property_change)
6199 (Fprevious_single_char_property_change):
6200 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6201 (copy_text_properties):
6202 Check for integer overflow in index calculation.
6203 * undo.c (last_boundary_position, record_point, record_insert)
6204 (record_delete, record_marker_adjustment, record_change)
6205 (record_property_change):
6206 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6207 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6208 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6209 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6210 (Fx_hide_tip, Fx_file_dialog):
6211 * w32menu.c (set_frame_menubar):
6212 Use ptrdiff_t, not int, for consistency with rest of code.
6213 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6214 (select_window, Fdelete_other_windows_internal)
6215 (window_scroll_pixel_based, window_scroll_line_based)
6216 (Frecenter, Fset_window_configuration):
6217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6218 (Fset_window_hscroll, run_window_configuration_change_hook)
6219 (set_window_buffer, temp_output_buffer_show, scroll_command)
6220 (Fscroll_other_window, Frecenter):
6221 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6222 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6223 Don't assume fixnum fits in int.
6224 (Fset_window_scroll_bars):
6225 Check that fixnums are in proper range for system types.
6226 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6227 (string_pos, c_string_pos, number_of_chars, init_iterator)
6228 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6229 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6230 (compute_display_string_end, handle_face_prop)
6231 (face_before_or_after_it_pos, handle_invisible_prop)
6232 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6233 (display_prop_intangible_p, string_buffer_position_lim)
6234 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6235 (get_overlay_strings_1, get_overlay_strings)
6236 (iterate_out_of_display_property, forward_to_next_line_start)
6237 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6238 (get_next_display_element, set_iterator_to_next)
6239 (get_visually_first_element, compute_stop_pos_backwards)
6240 (handle_stop_backwards, next_element_from_buffer)
6241 (move_it_in_display_line_to, move_it_in_display_line)
6242 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6243 (add_to_log, message_dolog, message_log_check_duplicate)
6244 (message2, message2_nolog, message3, message3_nolog
6245 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6246 (current_message_1, truncate_echo_area, truncate_message_1)
6247 (set_message, set_message_1, store_mode_line_noprop)
6248 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6249 (text_outside_line_unchanged_p, check_point_in_composition)
6250 (reconsider_clip_changes)
6251 (redisplay_internal, set_cursor_from_row, try_scrolling)
6252 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6253 (redisplay_window, find_last_unchanged_at_beg_row)
6254 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6255 (trailing_whitespace_p, find_row_edges, display_line)
6256 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6257 (display_mode_element, store_mode_line_string)
6258 (pint2str, pint2hrstr, decode_mode_spec)
6259 (display_count_lines, display_string, draw_glyphs)
6260 (x_produce_glyphs, x_insert_glyphs)
6261 (rows_from_pos_range, mouse_face_from_buffer_pos)
6262 (fast_find_string_pos, mouse_face_from_string_pos)
6263 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6264 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6265 (safe_call, init_from_display_pos, handle_fontified_prop)
6266 (handle_single_display_spec, load_overlay_strings)
6267 (with_echo_area_buffer, setup_echo_area_for_printing)
6268 (display_echo_area, echo_area_display)
6269 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6270 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6271 (redisplay_window, dump_glyph_row, display_mode_line)
6272 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6273 (handle_display_spec, display_prop_string_p):
6274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6275 (handle_single_display_spec, build_desired_tool_bar_string)
6276 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6277 (get_specified_cursor_type):
6278 Check that fixnums are in proper range for system types.
6279 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6280 (Flookup_image_map):
6281 Don't assume fixnums fit in int.
6282 (compare_overlay_entries):
6283 Avoid mishandling comparisons due to subtraction overflow.
6284 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6285 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6286 (handle_tool_bar_click):
6287 Use int, not unsigned, since we prefer signed and the signedness
6288 doesn't matter here.
6289 (get_next_display_element, next_element_from_display_vector):
6290 Use int, not EMACS_INT, when int is wide enough.
6291 (start_hourglass): Use duration_to_sec_usec to do proper
6292 overflow checking on durations.
6293 * xfaces.c (Fbitmap_spec_p):
6294 Check that fixnums are in proper range for system types.
6295 (compare_fonts_by_sort_order):
6296 Avoid mishandling comparisons due to subtraction overflow.
6297 (Fx_family_fonts, realize_basic_faces):
6298 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6299 (Fx_family_fonts):
6300 Don't assume fixnum fits in int.
6301 Use SAFE_ALLOCA_LISP, not alloca.
6302 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6303 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6304 (face_at_buffer_position, face_for_overlay_string)
6305 (face_at_string_position):
6306 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6307 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6308 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6309 (Fx_show_tip):
6310 Check that fixnums are in proper range for system types.
6311 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6312 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6313 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6314 (Fx_change_window_property): Don't assume fixnums fit in int.
6315 * xfont.c (xfont_chars_supported):
6316 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6317 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6318 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6319 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6320 * xml.c (parse_region):
6321 * xrdb.c (magic_file_p):
6322 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6323 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6324 (x_get_local_selection, x_reply_selection_request)
6325 (x_handle_selection_request, wait_for_property_change):
6326 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6327 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6328 short is wide enough.
6329 (x_send_client_event): Don't assume fixnum fits in int.
6330 * xterm.c (x_x_to_emacs_modifiers):
6331 Don't assume EMACS_INT overflows nicely into int.
6332 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6333 may come from Lisp.
6334 (handle_one_xevent): NATNUMP can eval its arg twice.
6335 (x_connection_closed):
6336 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6337 * xterm.h: Adjust decls to match defn changes elsewhere.
6338 (struct scroll_bar): Use struct vectorlike_header
6339 rather than rolling our own approximation.
6340 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6341
6342 2012-05-25 Glenn Morris <rgm@gnu.org>
6343
6344 * lisp.mk (lisp): Update for more files being compiled now.
6345
6346 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6347
6348 * lread.c: Remove `read_pure' which makes no difference.
6349 (read_pure): Remove var.
6350 (unreadpure): Remove function.
6351 (readevalloop): Don't call read_list with -1 flag.
6352 (read1, read_vector): Don't test read_pure any more.
6353 (read_list): Simplify.
6354
6355 * fileio.c, character.h: Minor style tweaks.
6356
6357 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6358
6359 * window.h (clip_changed): Remove useless declaration.
6360
6361 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6362
6363 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6364 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6365
6366 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6367
6368 Remove src/m/*.
6369 This directory predates autoconf and is no longer needed nowadays.
6370 Move its few remaining bits of functionality to where they're needed.
6371 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6372 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6373 * m/template.h: Remove.
6374 * Makefile.in (M_FILE): Remove. All uses removed.
6375 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6376 * lisp.h (USE_LSB_TAG):
6377 * mem-limits.h (EXCEEDS_LISP_PTR):
6378 Use VAL_MAX, not VALBITS, in #if.
6379 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6380 (EMACS_UINT): Define unconditionally now.
6381 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6382 (BITS_PER_EMACS_INT): New constants, replacing
6383 what used to be in config.h, but not useful in #if.
6384 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6385 define them any more.
6386 (VAL_MAX): New macro.
6387 (VALMASK): Use it.
6388 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6389 BITS_PER_EMACS_INT, in #if.
6390 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6391 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6392 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6393 * s/ms-w32.h (DATA_START):
6394 Move here from removed file m/intel386.h.
6395 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6396 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6397
6398 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6399
6400 Assume C89 or later.
6401 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6402 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6403 (xrealloc):
6404 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6405 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6406 * textprop.c, tparam.c (NULL): Remove.
6407 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6408 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6409 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6410 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6411 * xterm.c (input_signal_count): Assume volatile works.
6412
6413 2012-05-21 Ken Brown <kbrown@cornell.edu>
6414
6415 * xgselect.c (xg_select): Fix first argument in call to 'select'
6416 (bug#11508).
6417
6418 2012-05-20 Ken Brown <kbrown@cornell.edu>
6419
6420 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6421 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6422
6423 2012-05-19 Ken Brown <kbrown@cornell.edu>
6424
6425 * xfns.c (x_in_use): Remove `static' qualifier.
6426 * xterm.h (x_in_use): Declare.
6427 * xgselect.c: Include xterm.h.
6428 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6429 and `display_arg' (bug#9754).
6430
6431 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6432
6433 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6434
6435 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6436 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6437
6438 2012-05-18 Eli Zaretskii <eliz@gnu.org>
6439
6440 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6441
6442 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6443 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6444
6445 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6446 reference to image_cache->refcount.
6447 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6448
6449 2012-05-17 Juri Linkov <juri@jurta.org>
6450
6451 * search.c (Fword_search_regexp, Fword_search_backward)
6452 (Fword_search_forward, Fword_search_backward_lax)
6453 (Fword_search_forward_lax): Move functions to isearch.el
6454 (bug#10145, bug#11381).
6455
6456 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6457
6458 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6459
6460 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6461
6462 * lread.c (init_obarray): Declare Qt and Qnil as special.
6463
6464 2012-05-14 Glenn Morris <rgm@gnu.org>
6465
6466 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6467 Put "libexec" before "bin", for the sake of init_callproc_1.
6468
6469 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6470
6471 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6472
6473 * unexaix.c: Port to more-recent AIX compilers.
6474 (report_error, report_error_1, make_hdr, copy_sym)
6475 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6476 Make arguments const char *, not char *, to avoid violations of C
6477 standard and to fix some AIX warnings reported by Gilles Pion.
6478
6479 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6480
6481 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6482 already have overlays loaded.
6483 (handle_single_display_spec): Before returning without displaying
6484 fringe bitmap, synchronize the bidi iterator with the main display
6485 iterator, by calling iterate_out_of_display_property.
6486 (iterate_out_of_display_property): Detect buffer iteration by
6487 testing that it->string is a Lisp string.
6488 (get_next_display_element): When the current object is exhausted,
6489 and there's something on it->stack, call set_iterator_to_next to
6490 proceed with what's on the stack, instead of returning zero.
6491 (set_iterator_to_next): If called at the end of a Lisp string,
6492 proceed to consider_string_end without incrementing string
6493 position. Don't increment display vector index past the end of
6494 the display vector. (Bug#11417)
6495 (pos_visible_p): Don't report a position visible when move_it_to
6496 stopped at the last line of window, which happens to be scanned
6497 backwards by the bidi iteration. (Bug#11464)
6498
6499 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6500
6501 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6502 and right-margin display specs even if the spec is invalid or we
6503 are on a TTY, and thus unable to display on the fringes.
6504 That's because the text with the property will not be displayed anyway,
6505 so we need to signal to the caller that this is a "replacing"
6506 display spec. This fixes display when the spec is invalid or we
6507 are on a TTY.
6508
6509 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6510
6511 * unexaix.c (make_hdr): Fix typo in prototype.
6512 This bug broke the build on AIX. Problem reported by Gilles Pion.
6513
6514 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
6515
6516 * keyboard.c (kbd_buffer_get_event): Read special events also in
6517 batch mode. (Bug#11415)
6518
6519 2012-05-12 Glenn Morris <rgm@gnu.org>
6520
6521 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6522
6523 2012-05-12 Eli Zaretskii <eliz@gnu.org>
6524
6525 * lisp.mk (lisp): Add newcomment.elc.
6526
6527 2012-05-12 Glenn Morris <rgm@gnu.org>
6528
6529 * Makefile.in (MKDIR_P): New, set by configure.
6530 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6531
6532 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6533
6534 Remove unused function hourglass_started.
6535 * dispextern.h (hourglass_started):
6536 * w32fns.c (hourglass_started):
6537 * xdisp.c (hourglass_started): Remove.
6538
6539 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
6540
6541 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6542 Update dependencies.
6543
6544 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6545
6546 * xgselect.c (xg_select): Put maxfds+1 into a var.
6547 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6548
6549 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6550
6551 2012-05-10 Dave Abrahams <dave@boostpro.com>
6552
6553 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6554 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6555
6556 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
6557
6558 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6559 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6560 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6561 Initialize xd_registered_buses.
6562
6563 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6564
6565 Untag more efficiently if USE_LSB_TAG.
6566 This is based on a proposal by YAMAMOTO Mitsuharu in
6567 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6568 For an admittedly artificial (nth 8000 longlist) benchmark on
6569 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6570 Emacs's overall text size by 1%.
6571 * lisp.h (XUNTAG): New macro.
6572 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6573 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6574 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6575 * eval.c (Fautoload):
6576 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6577 * frame.h (XFRAME): Use XUNTAG.
6578
6579 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6580 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6581 Remove unportable assumptions about print widths of types like
6582 dbus_uint32_t.
6583 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6584 intptr_t when converting between pointer and integer, to avoid GCC
6585 warnings about wrong width.
6586
6587 2012-05-09 Eli Zaretskii <eliz@gnu.org>
6588
6589 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6590 stack for each reader_thread, instead of defaulting to 8MB
6591 determined by the linker. This avoids failures in creating
6592 subprocesses on Windows 7, see the discussion in this thread:
6593 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6594
6595 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6596
6597 Fix up display of the *Minibuf-0* buffer in the mini window.
6598 * keyboard.c (read_char): Don't clear the echo area if there's no
6599 message to clear.
6600 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
6601 contents of *Minibuf-0*) if there's no message displayed in its stead.
6602
6603 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
6604
6605 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6606 batch mode.
6607
6608 2012-05-06 Chong Yidong <cyd@gnu.org>
6609
6610 * lisp.mk (lisp): Update.
6611
6612 2012-05-05 Jim Meyering <meyering@redhat.com>
6613
6614 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6615
6616 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6617
6618 * data.c (PUT_ERROR): New macro.
6619 (syms_of_data): Use it. Add new error type `user-error'.
6620 * undo.c (user_error): New function.
6621 (Fprimitive_undo): Use it.
6622 * print.c (print_error_message): Adjust print style for `user-error'.
6623 * keyboard.c (user_error): New function.
6624 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6625
6626 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6627
6628 Do not limit current-time-string to years 1000..9999.
6629 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6630 (Fcurrent_time_string): Support any year that is supported by the
6631 underlying localtime representation. Don't use asctime, as it
6632 has undefined behavior for years outside the range -999..9999.
6633
6634 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6635
6636 Fix race conditions involving setenv, gmtime, localtime, asctime.
6637 Without this fix, interrupts could mess up code that uses these
6638 nonreentrant functions, since setting TZ invalidates existing
6639 tm_zone or tzname values, and since most of these functions return
6640 pointers to static storage.
6641 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6642 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6643 Grow the critical sections to include not just invoking
6644 localtime/gmtime, but also accessing these functions' results
6645 including their tm_zone values if any, and any related TZ setting.
6646 (format_time_string): Last arg is now struct tm *, not struct tm **,
6647 so that the struct tm is saved in the critical section.
6648 All callers changed. Simplify allocation of initial buffer, partly
6649 motivated by the fact that memory allocation needs to be outside
6650 the critical section.
6651
6652 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6653
6654 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6655 with RESET_INTERVAL.
6656
6657 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6658 Remove duplicated buffer name initialization.
6659
6660 2012-05-02 Jim Meyering <jim@meyering.net>
6661
6662 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6663
6664 * xfns.c (x_window): Use xstrdup (Bug#11375).
6665
6666 2012-05-02 Eli Zaretskii <eliz@gnu.org>
6667
6668 * xdisp.c (pos_visible_p): If already at a newline from the
6669 display string before the 'while' loop, don't walk back the glyphs
6670 from it3.glyph_row. Solves assertion violation when the display
6671 string begins with a newline (egg.el). (Bug#11367)
6672
6673 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6674
6675 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6676 Move to simple.el.
6677
6678 2012-05-01 Glenn Morris <rgm@gnu.org>
6679
6680 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6681 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6682 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6683 All were removed before 23.1.
6684
6685 * dispnew.c: Remove HAVE_LIBNCURSES test;
6686 it is always true on relevant platforms.
6687
6688 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6689 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6690
6691 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6692
6693 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6694
6695 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6696 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6697 Remove.
6698
6699 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6700
6701 Do not avoid creating empty evaporating overlays (Bug#9642).
6702 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6703 That is, do not delete an evaporating overlay if it becomes
6704 empty after its bounds are adjusted to fit within its buffer.
6705 This fix caused other problems, and I'm reverting it until we get
6706 to the bottom of them.
6707
6708 2012-04-27 Chong Yidong <cyd@gnu.org>
6709
6710 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6711
6712 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6713
6714 * xdisp.c (pos_visible_p): If the window start position is beyond
6715 ZV, start the display from buffer beginning. Prevents assertion
6716 violation in init_iterator when the minibuffer window is scrolled
6717 via the scroll bar.
6718
6719 * window.c (window_scroll_pixel_based): Likewise.
6720
6721 2012-04-27 Chong Yidong <cyd@gnu.org>
6722
6723 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6724
6725 2012-04-27 Glenn Morris <rgm@gnu.org>
6726
6727 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6728 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6729
6730 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6731
6732 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6733 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
6734
6735 2012-04-26 Eli Zaretskii <eliz@gnu.org>
6736
6737 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6738 display element, check also the underlying string or buffer
6739 character. (Bug#11341)
6740
6741 * w32menu.c: Include w32heap.h.
6742 (add_menu_item): If the call to AppendMenuW (via
6743 unicode_append_menu) fails, disable Unicode menus only if we are
6744 running on Windows 9X/Me.
6745
6746 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6747
6748 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6749 (xgetint): Add missing shift for LSB tags.
6750
6751 2012-04-24 Martin Rudalics <rudalics@gmx.at>
6752
6753 * keyboard.c (read_char): Don't wipe echo area for select window
6754 events: These might get delayed via `mouse-autoselect-window'
6755 (Bug#11304).
6756
6757 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
6758
6759 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6760 manipulation of :loaded-from data.
6761
6762 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
6763
6764 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6765 now a cons (bug#11311).
6766
6767 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6768
6769 Do not create empty overlays with the evaporate property (Bug#9642).
6770 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6771 if it becomes empty after its bounds are adjusted to fit within
6772 its buffer. Without this fix, in a nonempty buffer (let ((o
6773 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6774 yields an empty overlay that has the evaporate property, which is
6775 not supposed to happen.
6776
6777 Fix minor GTK3 problems found by static checking.
6778 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6779 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6780 (struct _EmacsFixedClass, emacs_fixed_get_type):
6781 Move decls here from emacsgtkfixed.h, since they needn't be public.
6782 (emacs_fixed_get_type): Now static.
6783 (emacs_fixed_class_init): Omit unused local.
6784 (emacs_fixed_child_type): Remove; unused.
6785 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6786 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6787 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6788 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6789 (EMACS_FIXED_GET_CLASS): Remove; unused.
6790 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6791
6792 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6793 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6794
6795 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6796
6797 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
6798 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
6799 (__malloc_size_t, __malloc_ptrdiff_t):
6800 Remove. All uses removed, replaced by the definiens if needed,
6801 since we can assume C89 or better now.
6802 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6803 (protect_malloc_state, align, get_contiguous_space)
6804 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6805 (malloc_atfork_handler_child, malloc_enable_thread)
6806 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6807 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6808 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6809 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6810 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6811 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6812 Define using prototypes, not old style.
6813 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6814 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6815 (align): Don't assume that signed integer overflow wraps around.
6816 Omit unused local var.
6817 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6818 (_free_internal_nolock, memalign, mallochook, reallochook):
6819 Omit no-longer-needed casts.
6820 (valloc): Use getpagesize, not __getpagesize.
6821 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6822 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6823
6824 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6825
6826 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
6827
6828 Move functions from C to Lisp. Make non-blocking method calls
6829 the default. Implement further D-Bus standard interfaces.
6830
6831 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6832 (QCdbus_request_name_allow_replacement)
6833 (QCdbus_request_name_replace_existing)
6834 (QCdbus_request_name_do_not_queue)
6835 (QCdbus_request_name_reply_primary_owner)
6836 (QCdbus_request_name_reply_in_queue)
6837 (QCdbus_request_name_reply_exists)
6838 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6839 (QCdbus_registered_serial, QCdbus_registered_method)
6840 (QCdbus_registered_signal): New Lisp objects.
6841 (XD_DEBUG_MESSAGE): Use sizeof.
6842 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6843 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6844 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6845 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6846 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6847 (xd_signature, xd_append_arg): Allow float for integer types.
6848 (xd_get_connection_references): New function.
6849 (xd_get_connection_address): Rename from xd_initialize.
6850 Return cached address.
6851 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6852 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6853 level.
6854 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
6855 Return number of refcounts.
6856 (Fdbus_get_unique_name): Make stronger parameter check.
6857 (Fdbus_message_internal): New defun.
6858 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6859 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6860 (Fdbus_send_signal, Fdbus_register_service)
6861 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6862 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6863 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6864 (Vdbus_compiled_version, Vdbus_runtime_version)
6865 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6866 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6867 (Vdbus_message_type_signal): New defvars.
6868 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6869 Adapt docstring.
6870
6871 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6872
6873 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6874 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6875 Do not assume ptrdiff_t is the same width as 'int'.
6876
6877 * alloc.c: Handle unusual debugging option combinations.
6878 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6879 since the two debugging options are incompatible.
6880 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6881 is defined.
6882 (mem_init, mem_insert, mem_insert_fixup):
6883 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6884 (NEED_MEM_INSERT): Remove; no longer needed.
6885
6886 2012-04-22 Leo Liu <sdl.web@gmail.com>
6887
6888 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6889
6890 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6891
6892 * sysdep.c [__FreeBSD__]: Minor cleanups.
6893 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6894 Use Emacs indenting style more consistently. Avoid some casts.
6895 Use 'double' consistently rather than mixing 'float' and 'double'.
6896
6897 2012-04-21 Eduard Wiebe <usenet@pusto.de>
6898
6899 * sysdep.c (list_system_processes, system_process_attributes):
6900 Add implementation for FreeBSD (Bug#5243).
6901
6902 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6903
6904 * lisp.mk (lisp): Update.
6905
6906 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6907
6908 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6909 It is never used otherwise.
6910
6911 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6912
6913 * print.c (print_preprocess): Only check print_depth if print-circle
6914 is nil.
6915 (print_object): Check for cycles even when print-circle is nil and
6916 print-gensym is t, but only check print_depth if print-circle is nil.
6917
6918 2012-04-20 Chong Yidong <cyd@gnu.org>
6919
6920 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6921 set the status to "failed" and ensure that sentinel is run.
6922
6923 2012-04-20 Glenn Morris <rgm@gnu.org>
6924
6925 * process.c (Fset_process_inherit_coding_system_flag)
6926 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
6927 (Fmake_network_process, Fmake_serial_process): Doc fix.
6928
6929 2012-04-20 Eli Zaretskii <eliz@gnu.org>
6930
6931 * xdisp.c (string_buffer_position_lim): Limit starting position to
6932 BEGV.
6933 (set_cursor_from_row): If called for a mode-line or header-line
6934 row, return zero immediately.
6935 (try_cursor_movement): If inside continuation line, don't back up
6936 farther than the first row after the header line, if any.
6937 Don't consider the header-line row as "partially visible", even if
6938 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6939
6940 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6941
6942 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6943 (bug#11238).
6944
6945 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6946 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
6947
6948 configure: new option --enable-gcc-warnings (Bug#11207)
6949 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6950 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6951 (ALL_CFLAGS): Use new macros rather than old.
6952 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6953 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6954 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6955 -Wunused-result, -Wunused-variable. This should go away once
6956 the Emacs and Gnulib regex code is merged.
6957 (xmalloc, xrealloc): Now static.
6958
6959 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6960
6961 * dired.c (Fsystem_groups): Remove unused local.
6962
6963 2012-04-17 Glenn Morris <rgm@gnu.org>
6964
6965 * dired.c (Fsystem_users): Doc fix.
6966
6967 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6968
6969 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6970 (syms_of_dired): Add them.
6971
6972 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6973
6974 Fix minor alloc.c problems found by static checking.
6975 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6976 New extern decls, to avoid calling undeclared functions.
6977 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6978 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6979 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6980 (NEED_MEM_INSERT): New macro.
6981 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
6982 Remove one incorrect comment and fix another.
6983
6984 Fix minor ralloc.c problems found by static checking.
6985 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6986 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6987 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6988 (r_alloc_sbrk): Now static.
6989
6990 Improve ralloc.c interface checking.
6991 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6992 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6993 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6994 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6995 [REL_ALLOC]: ... to here, to check interface.
6996 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6997 Remove decls. This fixes an "It stinks!".
6998
6999 * alloc.c (which_symbols): Fix alignment issue / type clash.
7000
7001 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7002
7003 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7004 (struct Lisp_Misc_Any): Likewise.
7005 (struct Lisp_Free): Likewise.
7006 * alloc.c (union aligned_Lisp_Symbol): Define.
7007 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7008 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7009 (union aligned_Lisp_Misc): Define.
7010 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7011 aligned_Lisp_Misc instead of union Lisp_Misc.
7012 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7013
7014 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7015
7016 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7017 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7018 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7019 * s/netbsd.h, s/sol2-6.h:
7020 Remove definition of GC_MARK_STACK, since the default now works.
7021 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7022 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7023 no longer the default.
7024 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7025
7026 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7027
7028 * lread.c (lisp_file_lexically_bound_p):
7029 Fix hang at ";-*-\n" (bug#11238).
7030
7031 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7032
7033 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7034 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7035
7036 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7037
7038 * nsterm.m (constrainFrameRect): Always constrain when there is only
7039 one screen (Bug#10962).
7040
7041 2012-04-13 Ken Brown <kbrown@cornell.edu>
7042
7043 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7044
7045 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7046
7047 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7048
7049 2012-04-11 Daniel Colascione <dancol@dancol.org>
7050
7051 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7052 against is gone. It's better to use vfork now so that when Cygwin
7053 gains a new, working vfork, we use it automatically (bug#10398).
7054
7055 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7056
7057 * window.c (save_window_save): Obey window-point-insertion-type.
7058
7059 2012-04-11 Glenn Morris <rgm@gnu.org>
7060
7061 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7062
7063 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7064
7065 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7066
7067 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7068
7069 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7070 (force_quit_count): New var.
7071 (handle_interrupt): Use it.
7072
7073 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7074
7075 * w32.c (w32_delayed_load): Record the full path of the library
7076 being loaded (bug#10424).
7077
7078 2012-04-09 Glenn Morris <rgm@gnu.org>
7079
7080 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7081 not just in the obarray, before snarfing them. (Bug#11036)
7082
7083 * Makefile.in ($(leimdir)/leim-list.el):
7084 Pass EMACS rather than BUILT_EMACS.
7085
7086 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7087
7088 * process.c (make_process):
7089 * process.h: Add integer `gnutls_handshakes_tried' member to
7090 process struct.
7091
7092 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7093 Add convenience `GNUTLS_LOG2i' macro.
7094
7095 * gnutls.c (gnutls_log_function2i): Convenience log function.
7096 (emacs_gnutls_read): Use new log functions,
7097 `gnutls_handshakes_tried' process member, and
7098 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7099 attempts per process (connection).
7100
7101 2012-04-09 Chong Yidong <cyd@gnu.org>
7102
7103 * eval.c (Fuser_variable_p, user_variable_p_eh)
7104 (lisp_indirect_variable): Functions deleted.
7105 (Fdefvar): Caller changed.
7106
7107 * callint.c (Finteractive, Fcall_interactively):
7108 * minibuf.c (Fread_variable): Callers changed.
7109
7110 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7111
7112 * xdisp.c (set_cursor_from_row): If the display string appears in
7113 the buffer at position that is closer to point than the position
7114 after the display string, display the cursor on the first glyph of
7115 the display string. Fixes cursor display when a 'display' text
7116 property immediately follows invisible text. (Bug#11094)
7117
7118 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7119
7120 composite.c: use 'double' consistently
7121 * composite.c (get_composition_id): Use 'double' consistently
7122 instead of converting 'float' to 'double' and vice versa; this is
7123 easier to understand and avoids a GCC warning.
7124
7125 2012-04-09 Glenn Morris <rgm@gnu.org>
7126
7127 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7128 preparation for dumping it with emacs. (Bug#4789)
7129 (leimdir): New variable.
7130 ($(leimdir)/leim-list.el): New rule.
7131 (emacs$(EXEEXT)): Depend on leim-list.el.
7132
7133 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7134 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7135 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7136
7137 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7138
7139 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7140 proper alignment.
7141
7142 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7143
7144 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7145 Remove unused local variable.
7146
7147 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7148
7149 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7150 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7151 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7152 objects, as mark_maybe_pointer will catch them otherwise.
7153 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7154 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7155
7156 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7157
7158 Fix typo that broke non-Windows builds.
7159 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7160
7161 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7162
7163 Support building on MS-Windows with libxml2.
7164
7165 * makefile.w32-in (OBJ2): Add xml.$(O).
7166 (GLOBAL_SOURCES): Add xml.c.
7167 ($(BLD)/xml.$(O)): New dependency list.
7168
7169 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7170 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7171 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7172 [!WINDOWSNT]: New macros.
7173 (init_libxml2_functions, libxml2_loaded_p): New functions.
7174 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7175 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7176 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7177 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7178 linked in).
7179 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7180 Call init_libxml2_functions before calling libxml2 functions.
7181 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7182
7183 * emacs.c: Don't include libxml/parser.h.
7184 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7185 xmlCleanupParser directly.
7186
7187 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7188
7189 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7190
7191 * indent.c (Fvertical_motion): If there is a display string at
7192 point, use it.vpos to compute how many lines to backtrack after
7193 move_it_to point. (Bug#11133)
7194
7195 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7196
7197 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7198 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7199 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7200 macros related to unification of CJK characters. For the details,
7201 see the discussion following the message here:
7202 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7203
7204 2012-04-04 Chong Yidong <cyd@gnu.org>
7205
7206 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7207
7208 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7209
7210 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7211 instead of alloca. (Bug#11138)
7212
7213 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7214
7215 * w32menu.c (is_simple_dialog): Properly check lisp types.
7216 (Bug#11141)
7217
7218 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7219
7220 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7221 position we get to after a call to move_it_to fails the
7222 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7223 only if we wind up in a string from display property. (Bug#11063)
7224
7225 * window.c (Fdelete_other_windows_internal): Invalidate the row
7226 and column information about mouse highlight, so that redisplay
7227 restores it after reallocating the glyph matrices. (Bug#7464)
7228
7229 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7230 string comes from a `display' text property, use the buffer
7231 position of that property as if we actually saw that position in
7232 the row's glyphs.
7233 (move_it_by_lines): Remove the assertion that
7234 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7235 violated when there's a before-string at the beginning of a line.
7236 (Bug#11063)
7237
7238 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7239
7240 * xdisp.c (append_space_for_newline): If the default face was
7241 remapped, use the remapped face for the appended newline.
7242 (extend_face_to_end_of_line): Use the remapped default face for
7243 extending the face to the end of the line.
7244 (display_line): Call extend_face_to_end_of_line when the default
7245 face was remapped. (Bug#11068)
7246
7247 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7248
7249 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7250
7251 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7252
7253 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7254
7255 2012-03-27 Glenn Morris <rgm@gnu.org>
7256
7257 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7258 Doc fixes.
7259
7260 2012-03-26 Kenichi Handa <handa@m17n.org>
7261
7262 * dispextern.h (struct glyph): Fix previous change. Change the
7263 bit length of glyphless.ch to 25 (Bug#11082).
7264
7265 2012-03-26 Chong Yidong <cyd@gnu.org>
7266
7267 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7268 (command_loop_1): Use it; inhibit selection update for
7269 handle-select-window too (Bug#8996).
7270
7271 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7272
7273 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7274
7275 2012-03-25 Kenichi Handa <handa@m17n.org>
7276
7277 * dispextern.h (struct glyph): Change the bit length of
7278 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7279
7280 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7281
7282 * s/ms-w32.h (tzname): Include time.h before redirecting to
7283 _tzname. Fixes the MSVC build. (Bug#9960)
7284
7285 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7286
7287 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7288 characters.
7289
7290 * xterm.c (XTread_socket): Only modify handling_signal if
7291 !SYNC_INPUT. (Bug#11080)
7292
7293 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7294
7295 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7296 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7297 when fetching a multibyte character consumes more bytes than
7298 CHAR_BYTES returns, due to unification of CJK characters in
7299 string_char. (Bug#11073)
7300
7301 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7302
7303 * process.c (wait_reading_process_output): Handle pty disconnect
7304 by refraining from sending oneself a SIGCHLD (bug#10933).
7305
7306 2012-03-22 Chong Yidong <cyd@gnu.org>
7307
7308 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7309
7310 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7311 Mark string as coming from a prefix property.
7312 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7313 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7314
7315 2012-03-21 Chong Yidong <cyd@gnu.org>
7316
7317 * xfaces.c (Vface_remapping_alist): Doc fix.
7318
7319 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7320
7321 * w32proc.c (Fw32_set_console_codepage)
7322 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7323 Doc fixes.
7324
7325 2012-03-20 Chong Yidong <cyd@gnu.org>
7326
7327 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7328 to reflect default non-nil value of redisplay-dont-pause.
7329
7330 2012-03-19 Kenichi Handa <handa@m17n.org>
7331
7332 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7333 it fit in a valid range (Bug#11003).
7334
7335 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7336
7337 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7338 that is not from display property, accept the row as a "cursor
7339 row" if one of the string's character has a non-nil `cursor'
7340 property. Fixes cursor positioning when there are newlines in
7341 overlay strings, e.g. in icomplete.el. (Bug#11035)
7342
7343 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7344
7345 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7346
7347 2012-03-12 Chong Yidong <cyd@gnu.org>
7348
7349 * eval.c (inhibit_lisp_code): Rename from
7350 inhibit_window_configuration_change_hook; move from window.c.
7351
7352 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7353 * window.c (run_window_configuration_change_hook)
7354 (syms_of_window): Callers changed.
7355
7356 2012-03-11 Chong Yidong <cyd@gnu.org>
7357
7358 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7359
7360 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7361
7362 2012-03-10 Chong Yidong <cyd@gnu.org>
7363
7364 * frame.c (other_visible_frames): Don't assume the selected frame
7365 is visible (Bug#10955).
7366
7367 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7368
7369 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7370
7371 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7372
7373 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7374 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7375 zero (Bug#10954).
7376
7377 2012-03-03 Glenn Morris <rgm@gnu.org>
7378
7379 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7380
7381 2012-03-02 Eli Zaretskii <eliz@gnu.org>
7382
7383 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7384 position past the first glyph_row that ends at ZV. (Bug#10902)
7385 (redisplay_window, next_element_from_string): Fix typos in
7386 comments.
7387 (redisplay_window): Pass to move_it_vertically the margin in
7388 pixels, not in screen lines.
7389
7390 2012-03-02 Glenn Morris <rgm@gnu.org>
7391
7392 * buffer.c (buffer-list-update-hook): Doc fix.
7393
7394 2012-02-29 Eli Zaretskii <eliz@gnu.org>
7395
7396 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7397 push_it before setting up the iterator for the first overlay
7398 string, even if we have an empty string loaded.
7399 (next_overlay_string): If there's an empty string on the iterator
7400 stack, pop the stack. (Bug#10903)
7401
7402 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7403
7404 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7405 Suggested by Stefan Monnier in
7406 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7407 * alloc.c (widen_to_Lisp_Object): New static function.
7408 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7409 and widening them to Lisp_Objects. This would work even if
7410 USE_LSB_TAG is defined and wide integers are used, which might
7411 happen in a future version of Emacs.
7412
7413 2012-02-25 Chong Yidong <cyd@gnu.org>
7414
7415 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7416 Doc fix.
7417
7418 * xselect.c (Fx_selection_exists_p): Doc fix.
7419 (x_clipboard_manager_save_all): Print an informative message
7420 before saving to clipboard manager.
7421
7422 2012-02-24 Chong Yidong <cyd@gnu.org>
7423
7424 * keyboard.c (process_special_events): Handle all X selection
7425 requests in kbd_buffer, not just the next one (Bug#8869).
7426
7427 2012-02-23 Chong Yidong <cyd@gnu.org>
7428
7429 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7430 call when setting menu-bar-lines and tool-bar-lines parameters.
7431 (unwind_create_frame_1): New helper function.
7432
7433 * window.c (inhibit_window_configuration_change_hook): New var.
7434 (run_window_configuration_change_hook): Obey it.
7435 (syms_of_window): Initialize it.
7436
7437 2012-02-22 Chong Yidong <cyd@gnu.org>
7438
7439 * xterm.c (x_draw_image_relief): Add missing type check for
7440 Vtool_bar_button_margin (Bug#10743).
7441
7442 2012-02-21 Chong Yidong <cyd@gnu.org>
7443
7444 * fileio.c (Vfile_name_handler_alist): Doc fix.
7445
7446 * buffer.c (Fget_file_buffer): Protect against invalid file
7447 handler return value.
7448
7449 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7450
7451 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7452 when computing $valmask.
7453
7454 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7455 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7456 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7457 It's useless in that case, and it can cause problems on hosts
7458 that allocate halves of EMACS_INT values separately.
7459 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7460 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7461 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7462 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7463 it avoids undefined behavior on hosts where shifting right by more
7464 than the word width has undefined behavior.
7465
7466 2012-02-19 Chong Yidong <cyd@gnu.org>
7467
7468 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7469 (Funhandled_file_name_directory, Ffile_name_as_directory)
7470 (Fdirectory_file_name, Fexpand_file_name)
7471 (Fsubstitute_in_file_name): Protect against invalid file handler
7472 return values (Bug#10845).
7473
7474 2012-02-18 Eli Zaretskii <eliz@gnu.org>
7475
7476 * .gdbinit (pitx): Fix incorrect references to fields of the
7477 iterator stack.
7478
7479 2012-02-17 Chong Yidong <cyd@gnu.org>
7480
7481 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7482
7483 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7484
7485 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7486 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7487
7488 2012-02-15 Chong Yidong <cyd@gnu.org>
7489
7490 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7491 marked as special. Also, starting docstrings with * is obsolete.
7492
7493 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7494
7495 * gnutls.c (emacs_gnutls_write): Fix last change.
7496
7497 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7498
7499 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7500 send_process.
7501
7502 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7503
7504 * keymap.c (Fsingle_key_description): Handle char ranges.
7505
7506 2012-02-12 Chong Yidong <cyd@gnu.org>
7507
7508 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7509 as that creates a dangerous corner case.
7510
7511 * window.c (Fdelete_window_internal): Invalidate the mouse
7512 highlight (Bug#9904).
7513
7514 2012-02-12 Glenn Morris <rgm@gnu.org>
7515
7516 * xselect.c (Fx_own_selection_internal)
7517 (Fx_get_selection_internal, Fx_disown_selection_internal)
7518 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7519 * nsselect.m (Fx_own_selection_internal)
7520 (Fx_disown_selection_internal, Fx_selection_exists_p)
7521 (Fx_selection_owner_p, Fx_get_selection_internal):
7522 Sync docs and argument specs with the xselect.c versions.
7523
7524 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7525
7526 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7527
7528 2012-02-11 Eli Zaretskii <eliz@gnu.org>
7529
7530 * w32select.c (Fx_selection_exists_p): Sync doc string and
7531 argument list with xselect.c. (Bug#10783)
7532
7533 * w16select.c (Fx_selection_exists_p): Sync doc string and
7534 argument list with xselect.c. (Bug#10783)
7535
7536 2012-02-10 Glenn Morris <rgm@gnu.org>
7537
7538 * fns.c (Fsecure_hash): Doc fix.
7539
7540 2012-02-09 Kenichi Handa <handa@m17n.org>
7541
7542 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7543
7544 2012-02-07 Chong Yidong <cyd@gnu.org>
7545
7546 * buffer.c (Fbuffer_local_variables)
7547 (buffer_lisp_local_variables): Handle unbound vars correctly;
7548 don't let Qunbound leak into Lisp.
7549
7550 2012-02-07 Glenn Morris <rgm@gnu.org>
7551
7552 * image.c (Fimagemagick_types): Doc fix.
7553
7554 * image.c (imagemagick-render-type): Change it from a lisp object
7555 to an integer. Move the doc here from the lisp manual.
7556 Treat all values not equal to 0 the same.
7557
7558 2012-02-06 Chong Yidong <cyd@gnu.org>
7559
7560 * doc.c (store_function_docstring): Avoid applying docstring of
7561 alias to base function (Bug#2603).
7562
7563 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7564
7565 * .gdbinit (pp1, pv1): Remove redundant defines.
7566 (pr): Use pp.
7567
7568 2012-02-04 Chong Yidong <cyd@gnu.org>
7569
7570 * nsterm.m: Declare a global (Bug#10694).
7571
7572 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7573
7574 * w32.c (get_emacs_configuration_options):
7575 Include --enable-checking, if specified, in the return value.
7576
7577 2012-02-04 Martin Rudalics <rudalics@gmx.at>
7578
7579 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7580 after rounding frame sizes. (Bug#9723)
7581
7582 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7583
7584 * keyboard.c (adjust_point_for_property): Don't position point
7585 before BEGV. (Bug#10696)
7586
7587 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7588
7589 Handle overflow when computing char display width (Bug#9496).
7590 * character.c (char_width): Return EMACS_INT, not int.
7591 (char_width, c_string_width): Check for overflow when
7592 computing the width; this is possible now that individual
7593 characters can have unbounded width. Problem introduced
7594 by merge from Emacs 23 on 2012-01-19.
7595
7596 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
7597
7598 * dbusbind.c (Fdbus_register_method): Mention the return value
7599 :ignore in the docstring.
7600
7601 2012-02-02 Glenn Morris <rgm@gnu.org>
7602
7603 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7604
7605 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7606 Unconditionally set to t. (Bug#10673)
7607 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7608 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7609 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7610
7611 2012-02-02 Kenichi Handa <handa@m17n.org>
7612
7613 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7614 0, do not call append_composite_glyph.
7615
7616 2012-02-02 Kenichi Handa <handa@m17n.org>
7617
7618 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7619 NULL (Bug#6988).
7620 (x_produce_glyphs): If the component of a composition is a null
7621 string, set it->pixel_width to 1 to avoid zero-width glyph.
7622
7623 2012-02-01 Eli Zaretskii <eliz@gnu.org>
7624
7625 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7626 first 2 arguments are identical. This makes inserting large
7627 output from a subprocess an order of magnitude faster on
7628 MS-Windows, where all sbrk'ed memory is always contiguous.
7629
7630 2012-01-31 Glenn Morris <rgm@gnu.org>
7631
7632 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7633 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7634 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7635
7636 2012-01-29 Glenn Morris <rgm@gnu.org>
7637
7638 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7639
7640 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7641
7642 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7643
7644 2012-01-28 Chong Yidong <cyd@gnu.org>
7645
7646 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7647
7648 2012-01-26 Chong Yidong <cyd@gnu.org>
7649
7650 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7651
7652 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7653 repeat counts (Bug#10507).
7654
7655 2012-01-26 Glenn Morris <rgm@gnu.org>
7656
7657 * lread.c (syms_of_lread): Doc fix.
7658
7659 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7660
7661 * coding.c (encode_designation_at_bol): Change return value to
7662 EMACS_INT.
7663
7664 2012-01-25 Chong Yidong <cyd@gnu.org>
7665
7666 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7667
7668 2012-01-21 Chong Yidong <cyd@gnu.org>
7669
7670 * floatfns.c (Fcopysign): Make the second argument non-optional,
7671 since nil is not allowed anyway.
7672
7673 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7674
7675 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7676 (send_process): Likewise.
7677
7678 2012-01-19 Martin Rudalics <rudalics@gmx.at>
7679
7680 * window.c (save_window_save, Fcurrent_window_configuration)
7681 (Vwindow_persistent_parameters): Do not use Qstate.
7682 Rewrite doc-strings.
7683
7684 2012-01-19 Kenichi Handa <handa@m17n.org>
7685
7686 * character.c (char_width): New function.
7687 (Fchar_width, c_string_width, lisp_string_width):
7688 Use char_width (Bug#9496).
7689
7690 2012-01-16 Martin Rudalics <rudalics@gmx.at>
7691
7692 * window.c (Vwindow_persistent_parameters): New variable.
7693 (Fset_window_configuration, save_window_save): Handle persistent
7694 window parameters.
7695
7696 2012-01-14 Eli Zaretskii <eliz@gnu.org>
7697
7698 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7699 thrashing the stack of the thread. (Bug#9087)
7700
7701 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7702
7703 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7704
7705 2012-01-11 Eli Zaretskii <eliz@gnu.org>
7706
7707 * xdisp.c (rows_from_pos_range): Handle the case where the
7708 highlight ends on a newline. (Bug#10464)
7709 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7710 he end column for display of highlight that ends on a newline
7711 before a R2L line.
7712
7713 2012-01-11 Glenn Morris <rgm@gnu.org>
7714
7715 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7716 from load-path also when installation-directory is nil. (Bug#10208)
7717
7718 2012-01-10 Glenn Morris <rgm@gnu.org>
7719
7720 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7721
7722 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7723 Update template values to be closer to their typical values these days.
7724
7725 2012-01-09 Eli Zaretskii <eliz@gnu.org>
7726
7727 * xdisp.c (rows_from_pos_range): Accept additional argument
7728 DISP_STRING, and accept any glyph in a row whose object is that
7729 string as eligible for mouse highlight. Fixes mouse highlight of
7730 display strings from overlays. (Bug#10464)
7731
7732 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
7733
7734 emacs: fix an auto-save permissions race condition (Bug#10400)
7735 * fileio.c (auto_saving_dir_umask): New static var.
7736 (Fmake_directory_internal): Use it.
7737 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7738 creating the directory. The old code temporarily assigns
7739 too-generous permissions to the directory.
7740 (do_auto_save_eh): Clear it.
7741 (Fdo_auto_save): Catch all errors, not just file errors, so
7742 that the var is always cleared.
7743
7744 2012-01-07 Eli Zaretskii <eliz@gnu.org>
7745
7746 * search.c (scan_buffer): Pass character positions to
7747 know_region_cache, not byte positions. (Bug#6540)
7748
7749 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
7750
7751 * w32.c (sys_rename): Report EXDEV when rename of a directory
7752 fails because the target is on another logical disk. (Bug#10284)
7753
7754 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7755
7756 * xterm.c (x_embed_request_focus): New function.
7757
7758 * xterm.h: Add prototype.
7759
7760 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7761
7762 2012-01-05 Glenn Morris <rgm@gnu.org>
7763
7764 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7765
7766 2012-01-01 Eli Zaretskii <eliz@gnu.org>
7767
7768 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7769 Load gnutls_transport_set_lowat only if GnuTLS version is below
7770 2.11.1.
7771 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7772 GnuTLS versions below 2.11.1.
7773
7774 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7775
7776 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7777 to the doc string advising against its use for altering the way
7778 windows are scrolled.
7779
7780 2011-12-28 Kenichi Handa <handa@m17n.org>
7781
7782 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7783 coding-system ASCII compatible only when it does not produce BOM
7784 on encoding (Bug#10383).
7785
7786 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7787
7788 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7789 can scroll.
7790 (create_and_show_popup_menu): Always use menu_position_func for
7791 Gtk3 (Bug#10361).
7792
7793 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7794
7795 * callint.c (Fcall_interactively): Don't truncate prompt string.
7796
7797 2011-12-23 Eli Zaretskii <eliz@gnu.org>
7798
7799 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7800 property that ends at ZV, so that the bidi iteration could be
7801 resumed from there (after widening). (Bug#10360)
7802
7803 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7804
7805 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7806
7807 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7808
7809 * nsterm.m (x_free_frame_resources):
7810 Release f->output_data.ns->miniimage.
7811 (ns_index_color): Fix indentation. Do not retain
7812 color_table->colors[i].
7813
7814 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7815 before returning.
7816
7817 * nsfns.m (x_set_background_color): Assign return value from
7818 ns_index_color to face-background instead of NSColor*.
7819 (ns_implicitly_set_icon_type): Fix indentation.
7820 Change assignment in for loop to comparison.
7821
7822 * emacs.c (ns_pool): New variable.
7823 (main): Assign ns_pool.
7824 (Fkill_emacs): Call ns_release_autorelease_pool.
7825
7826 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7827 autorelease fdesc, release fdAttrs and tdict.
7828 (ns_get_covering_families): Release charset.
7829 (ns_findfonts): Release NSFontDescriptor created with new.
7830 (ns_uni_to_glyphs): Fix indentation.
7831 (setString): Release attrStr before assigning new value.
7832
7833 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7834
7835 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7836 and NS_IMPL_COCOA.
7837 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7838 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7839
7840 2011-12-18 David Reitter <reitter@cmu.edu>
7841
7842 * nsterm.m (ns_term_init): Subscribe for notifications
7843 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7844 to method trackingNotification in EmacsMenu.
7845
7846 * nsmenu.m (trackingMenu): New variable.
7847 (trackingNotification): New method (from Aquamacs).
7848 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
7849 from Aquamacs (Bug#7030).
7850
7851 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7852
7853 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7854 (symbol_to_nsstring): Fix indentation.
7855 (ns_symbol_to_pb): New function.
7856 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7857 (Fns_rotate_cut_buffers_internal): Remove.
7858 (Fns_store_selection_internal): Rename from
7859 Fns_store_cut_buffer_internal.
7860 (ns_get_foreign_selection, Fx_own_selection_internal)
7861 (Fx_disown_selection_internal, Fx_selection_exists_p)
7862 (Fns_get_selection_internal, Fns_store_selection_internal):
7863 Use ns_symbol_to_pb and check if return value is nil.
7864 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7865 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
7866 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7867 renamed to Sns_store_selection_internal.
7868 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7869 and remove this function.
7870 (ns_handle_selection_clear): Remove, never used.
7871 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7872 here.
7873
7874 2011-12-17 Ken Brown <kbrown@cornell.edu>
7875
7876 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7877 GID is unknown (Bug#10257).
7878
7879 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7880
7881 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7882 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7883 which caused a build failure on GNU/Linux IA-64. This problem was
7884 introduced by my 2011-10-07 patch.
7885
7886 2011-12-15 Juri Linkov <juri@jurta.org>
7887
7888 * image.c (imagemagick_error): New function. (Bug#10112)
7889 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7890 Use `imagemagick_error' where ImageMagick functions return
7891 `MagickFalse'.
7892 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7893 proper order.
7894
7895 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7896
7897 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7898 fill background (Bug#8992).
7899
7900 2011-12-13 Martin Rudalics <rudalics@gmx.at>
7901
7902 * window.c (Vwindow_combination_resize)
7903 (Vwindow_combination_limit): Use t instead of non-nil in
7904 doc-strings.
7905 (Vrecenter_redisplay): Add first sentence of doc-string on
7906 separate line.
7907 (Frecenter): Fix doc-string typo.
7908
7909 2011-12-11 Kenichi Handa <handa@m17n.org>
7910
7911 * coding.c (Funencodable_char_position): Pay attention to the
7912 buffer text relocation (Bug#9389).
7913
7914 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7915
7916 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7917 gtk_init (Bug#10100).
7918
7919 2011-12-10 Eli Zaretskii <eliz@gnu.org>
7920
7921 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7922 IT->string is nil. (Bug#10263)
7923
7924 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7925
7926 * nsterm.h (x_free_frame_resources): Declare.
7927
7928 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7929 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7930
7931 * nsterm.h (ns_get_defaults_value): Declare.
7932
7933 * nsterm.m (ns_default): Call ns_get_defaults_value.
7934
7935 2011-12-09 Eli Zaretskii <eliz@gnu.org>
7936
7937 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7938 (Bug#10170)
7939
7940 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7941
7942 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7943 that where the value of an _OBJC_* symbol points to is in the .bss
7944 section (Bug#10240).
7945
7946 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7947
7948 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
7949 after the loop to call ccl_driver at least once (Bug#8619).
7950
7951 2011-12-08 Kenichi Handa <handa@m17n.org>
7952
7953 * ftfont.c (get_adstyle_property): Fix previous change
7954 (Bug#10233).
7955
7956 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
7957
7958 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7959 dirs from the default value of EMACSLOADPATH (bug#10208).
7960
7961 2011-12-07 Glenn Morris <rgm@gnu.org>
7962
7963 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7964 installation and source directories as well. (Bug#10208)
7965
7966 2011-12-06 Chong Yidong <cyd@gnu.org>
7967
7968 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7969
7970 2011-12-06 Glenn Morris <rgm@gnu.org>
7971
7972 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7973 as an error, not just -1. (Bug#10217)
7974
7975 2011-12-05 Chong Yidong <cyd@gnu.org>
7976
7977 * keyboard.c (process_special_events): New function.
7978 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7979
7980 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7981
7982 * coding.c (encode_designation_at_bol): Don't use uninitialized
7983 local variable (Bug#9318).
7984
7985 2011-12-05 Kenichi Handa <handa@m17n.org>
7986
7987 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7988 return Qnil (Bug#8046, Bug#10193).
7989
7990 2011-12-05 Kenichi Handa <handa@m17n.org>
7991
7992 * coding.c (encode_designation_at_bol): New args charbuf_end and
7993 dst. Return the number of produced bytes. Callers changed.
7994 (coding_set_source): Return how many bytes coding->source was
7995 relocated.
7996 (coding_set_destination): Return how many bytes
7997 coding->destination was relocated.
7998 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
7999 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8000
8001 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8002
8003 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8004 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8005 macro (Bug#9318).
8006
8007 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8008
8009 The following changes are to fix Bug#9318.
8010
8011 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8012 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8013 (encode_coding_iso_2022, encode_coding_sjis)
8014 (encode_coding_big5, encode_coding_charset): Use the above macros.
8015
8016 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8017
8018 * lisp.h (process_quit_flag): Fix external declaration.
8019
8020 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8021
8022 Don't macro-inline non-performance-critical code.
8023 * eval.c (process_quit_flag): New function.
8024 * lisp.h (QUIT): Use it.
8025
8026 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8027
8028 * nsfns.m (get_geometry_from_preferences): New function.
8029 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8030
8031 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8032
8033 * emacs.c (Qkill_emacs): Define.
8034 (syms_of_emacs): Initialize it.
8035 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8036 Qquit_flag to `kill-emacs' instead.
8037 (quit_throw_to_read_char): Add parameter `from_signal'.
8038 All callers changed. Call Fkill_emacs if requested and safe.
8039 * lisp.h (QUIT): Call Fkill_emacs if requested.
8040
8041 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8042
8043 * widget.c (update_wm_hints): Return if wmshell is null.
8044 (widget_update_wm_size_hints): New function.
8045
8046 * widget.h (widget_update_wm_size_hints): Declare.
8047
8048 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8049 widget_update_wm_size_hints (Bug#10104).
8050
8051 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8052
8053 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8054 before a newline, prepare the bidi iterator for consuming the
8055 newline, and keep the current paragraph direction. (Bug#10183)
8056 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8057
8058 2011-12-02 Juri Linkov <juri@jurta.org>
8059
8060 * search.c (Fword_search_regexp): New Lisp function created from
8061 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8062 (Fword_search_backward, Fword_search_forward)
8063 (Fword_search_backward_lax, Fword_search_forward_lax):
8064 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8065 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8066
8067 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8068
8069 * fileio.c (Finsert_file_contents): Move after-change-function call
8070 to before the "handled:" label, since all "goto handled" appear in
8071 cases where the *-change-functions have already been properly called
8072 (bug#10117).
8073
8074 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8075
8076 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8077 waiting for input. (Bug#10169)
8078
8079 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8080
8081 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8082 verifies glyph row's hash code--we have just reallocated the
8083 glyphs, so their contents can be complete garbage. (Bug#10164)
8084
8085 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8086
8087 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8088
8089 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8090
8091 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8092 attributes are tested _before_ calling verify_row_hash, to protect
8093 against GCC re-ordering of the tests. (Bug#10164)
8094
8095 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8096
8097 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8098
8099 * xterm.c (handle_one_xevent): Only set async_visible and friends
8100 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8101 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8102 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8103
8104 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8105
8106 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8107 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8108 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8109 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8110 All uses changed to use GCPRO1 etc.
8111 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8112 Revert to old implementation (i.e., before 2011-03-11).
8113
8114 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8115
8116 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8117 of scroll runs so as to avoid assigning disabled bogus rows and
8118 unnecessary graphics copy operations.
8119
8120 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8121
8122 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8123 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8124 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8125 (malloc, free, realloc, calloc): Redirect to e_* only when
8126 compiling Emacs.
8127
8128 * lisp.h (GCTYPEBITS): Move before first use.
8129 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8130 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8131 this macro definition.
8132
8133 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8134 _MSC_VER.
8135
8136 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8137
8138 * gtkutil.c (xg_create_frame_widgets):
8139 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8140 present with Gtk+ 2.0.
8141
8142 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8143
8144 * fileio.c (Finsert_file_contents): Undo previous change; see
8145 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8146
8147 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8148
8149 Rename locals to avoid shadowing.
8150 * fileio.c (Finsert_file_contents):
8151 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8152 * process.c (wait_reading_process_output):
8153 Rename inner 'proc' to 'p' to avoid shadowing.
8154 Indent for consistency with usual Emacs style.
8155
8156 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8157
8158 * xdisp.c (redisplay_window): If cursor row is not fully visible
8159 after recentering, and scroll-conservatively is set to a large
8160 number, scroll window by a few more lines to make the cursor fully
8161 visible and out of scroll-margin. (Bug#10105)
8162 (start_display): Don't move to the next line if the display should
8163 start at a newline that is part of a display vector or an overlay
8164 string. (Bug#10119)
8165
8166 2011-11-24 Juri Linkov <juri@jurta.org>
8167
8168 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8169 after the `MagickPingImage' call. (Bug#10112)
8170
8171 2011-11-23 Chong Yidong <cyd@gnu.org>
8172
8173 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8174
8175 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8176
8177 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8178 making another buffer current. (Bug#10114)
8179
8180 2011-11-23 Glenn Morris <rgm@gnu.org>
8181
8182 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8183
8184 2011-11-23 Chong Yidong <cyd@gnu.org>
8185
8186 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8187 using it (Bug#5984).
8188
8189 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8190
8191 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8192 and header-lines, as they don't have one computed for them.
8193 (Bug#10098)
8194
8195 * .gdbinit (prow): Make displayed values more self-explaining.
8196 Add row's hash code.
8197
8198 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8199
8200 * process.c (wait_reading_process_output): Fix asynchrounous
8201 GnuTLS socket handling on some versions of the GnuTLS library.
8202 (wait_reading_process_output): Add comment and URL.
8203
8204 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8205
8206 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8207
8208 2011-11-21 Chong Yidong <cyd@gnu.org>
8209
8210 * window.c (Fnext_window, Fprevious_window): Doc fix.
8211
8212 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8213
8214 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8215
8216 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8217
8218 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8219
8220 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8221
8222 * window.c (Fset_window_combination_limit): Rename argument
8223 STATUS to LIMIT.
8224 (Vwindow_combination_limit): Remove "status" from doc-string.
8225
8226 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8227
8228 * m/ibms390.h: Remove.
8229 * m/ibms390x.h: Don't include "ibms390.h".
8230
8231 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8232
8233 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8234 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8235
8236 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8237
8238 * casetab.c (Fset_case_table):
8239 * charset.c (Fcharset_after): Fix typos.
8240
8241 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8242
8243 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8244 Otherwise, valgrind does not work on some platforms.
8245 Problem reported by Andreas Schwab in
8246 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8247 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8248 is set, removing the need for VIRT_ADDRESS_VARIES.
8249 (PURE_P): Use a more-efficient implementation that needs just one
8250 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8251 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8252 to 4 (xorl, subq, cmpq, setbe).
8253 * alloc.c (pure): Always extern now, since that's the
8254 VIRT_ADDR_VARIES behavior.
8255 (PURE_POINTER_P): Use a single comparison, not two, for
8256 consistency with the new puresize.h.
8257 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8258 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8259 Remove VIRT_ADDR_VARIES no longer needed.
8260
8261 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8262
8263 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8264 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8265 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8266 behave as if the cursor position were at the window margin.
8267
8268 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8269 and the cursor position is out of bounds, behave as if the cursor
8270 position were at the window margin. (Bug#10075)
8271
8272 2011-11-18 Chong Yidong <cyd@gnu.org>
8273
8274 * window.c (Fwindow_combination_limit): Make first argument
8275 non-optional, since it is meaningless for live windows like the
8276 selected window.
8277
8278 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8279
8280 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8281
8282 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8283
8284 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8285 (graft_intervals_into_buffer): Simplify.
8286
8287 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8288
8289 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8290 hash values of the two rows.
8291 (copy_row_except_pointers): Preserve the used[] arrays and the
8292 hash values of the two rows. (Bug#10035)
8293 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8294
8295 * xdisp.c (row_hash): New function, body extracted from
8296 compute_line_metrics.
8297 (compute_line_metrics): Call row_hash, instead of computing the
8298 hash code inline.
8299
8300 * dispnew.c (verify_row_hash): Call row_hash for computing the
8301 hash code of a row, instead of duplicating code from xdisp.c.
8302
8303 * dispextern.h (row_hash): Add prototype.
8304
8305 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8306
8307 * frame.c (delete_frame): Don't delete the terminal when the last
8308 X frame is closed if emacs is built with GTK toolkit.
8309
8310 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8311
8312 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8313
8314 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8315
8316 * window.c (Vwindow_splits): Rename to
8317 Vwindow_combination_resize. Suggested by Juri Linkov.
8318 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8319 of Vwindow_splits.
8320
8321 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8322
8323 * nsfns.m (Fns_font_name):
8324 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8325
8326 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8327
8328 * window.h (window): Rename slot "nest" to "combination_limit".
8329 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8330 (Fset_window_nest): Rename to Fset_window_combination_limit.
8331 (Vwindow_nest): Rename to Vwindow_combination_limit.
8332 (recombine_windows, make_parent_window, make_window)
8333 (Fsplit_window_internal, saved_window)
8334 (Fset_window_configuration, save_window_save): Rename all
8335 occurrences of window_nest to window_combination_limit.
8336
8337 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8338
8339 * image.c (imagemagick_load_image): Fix typo.
8340
8341 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8342
8343 * xdisp.c (display_line): Move the call to
8344 highlight_trailing_whitespace before the call to
8345 compute_line_metrics, since the latter needs to see the final
8346 faces of all the glyphs to compute ROW's hash value.
8347 Fixes assertion violations in row_equal_p. (Bug#10035)
8348
8349 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8350
8351 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8352 just return (bug#10044).
8353
8354 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8355
8356 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8357 with user-defined heap size. Bump the default size of the temacs
8358 heap to 27MB, to avoid memory warning when running temacs.
8359 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8360
8361 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8362 current_matrix and desired_matrix. (Bug#9990)
8363 (verify_row_hash) [XASSERTS]: New function.
8364 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8365 that the hash value of glyph rows is correct.
8366
8367 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8368
8369 * window.h (window): Remove splits slot.
8370 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8371 (Fdelete_other_windows_internal, make_parent_window)
8372 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8373 (Fset_window_configuration, save_window_save): Don't deal with
8374 split status of windows.
8375 (saved_window): Remove splits slot.
8376 (Vwindow_splits): Rewrite doc-string.
8377
8378 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8379
8380 * xfns.c (unwind_create_frame):
8381 * nsfns.m (unwind_create_frame):
8382 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8383 Vframe_list (Bug#9999).
8384
8385 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8386
8387 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8388
8389 2011-11-11 Kenichi Handa <handa@m17n.org>
8390
8391 * callproc.c (Fcall_process): Set the member dst_multibyte of
8392 process_coding.
8393
8394 2011-11-11 Johan Bockgård <bojohan@gnu.org>
8395
8396 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8397 avoid a crash (bug#9496).
8398
8399 2011-11-09 Chong Yidong <cyd@gnu.org>
8400
8401 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8402 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8403
8404 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8405
8406 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8407
8408 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8409
8410 Avoid some portability problems by eschewing 'extern inline' functions.
8411 The trivial performance wins aren't worth the portability hassles; see
8412 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8413 et seq.
8414 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8415 (window_box_width, window_box_left, window_box_left_offset)
8416 (window_box_right, window_box_right_offset): Undo previous change,
8417 by removing the "extern"s.
8418 * intervals.c (adjust_intervals_for_insertion)
8419 (adjust_intervals_for_deletion): Undo previous change,
8420 making these static again.
8421 (offset_intervals, temp_set_point_both, temp_set_point)
8422 (copy_intervals_to_string): No longer inline.
8423 * xdisp.c (window_text_bottom_y, window_box_width)
8424 (window_box_height, window_box_left_offset)
8425 (window_box_right_offset, window_box_left, window_box_right)
8426 (window_box): No longer inline.
8427
8428 2011-11-08 Chong Yidong <cyd@gnu.org>
8429
8430 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
8431 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8432 Signal an error if not a live window.
8433 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8434 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8435
8436 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
8437
8438 * lisp.h (syms_of_abbrev): Remove declaration.
8439 Reported by CHENG Gao <chenggao@royau.me>.
8440
8441 2011-11-07 Eli Zaretskii <eliz@gnu.org>
8442
8443 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8444 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8445 of temacs in GUI mode.
8446
8447 2011-11-07 Martin Rudalics <rudalics@gmx.at>
8448
8449 * window.h: Declare delete_all_child_windows instead of
8450 delete_all_subwindows.
8451 * window.c (Fwindow_nest, Fset_window_nest)
8452 (Fset_window_new_total, Fset_window_new_normal)
8453 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8454 (delete_all_subwindows): Rename to delete_all_child_windows.
8455 (Fdelete_other_windows_internal, Fset_window_configuration):
8456 Call delete_all_child_windows instead of delete_all_subwindows.
8457 * frame.c (delete_frame): Call delete_all_child_windows instead
8458 of delete_all_subwindows.
8459
8460 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8461
8462 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8463 This is also needed for porting to any host where GC_MARK_STACK is
8464 not GC_MAKE_GCPROS_NOOPS.
8465 (which_symbols): Use it.
8466
8467 2011-11-07 Kenichi Handa <handa@m17n.org>
8468
8469 * coding.c (coding_set_destination): Check coding->src_pos only
8470 when coding->src_object is a buffer (bug#9910).
8471
8472 * process.c (send_process): Set the member src_multibyte of coding
8473 to 0 (bug#9911) when sending a unibyte text.
8474
8475 * callproc.c (Fcall_process): Set the member src_multibyte of
8476 process_coding to 0 (bug#9912).
8477
8478 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8479
8480 * xmenu.c (cleanup_widget_value_tree): New function.
8481 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8482 calling free_menubar_widget_value_tree directly (Bug#9830).
8483
8484 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8485
8486 Fix some portability problems with 'inline'.
8487 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8488 (window_box_width, window_box_left, window_box_left_offset)
8489 (window_box_right, window_box_right_offset): Declare extern.
8490 Otherwise, these inline functions do not conform to C99 and
8491 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8492 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8493 * intervals.c (adjust_intervals_for_insertion)
8494 (adjust_intervals_for_deletion): Now extern, because otherwise the
8495 extern inline functions 'offset_intervals' couldn't refer to it.
8496 (static_offset_intervals): Remove.
8497 (offset_intervals): Rewrite using the old contents of
8498 static_offset_intervals. The old version didn't conform to C99
8499 because an extern inline function contained a reference to an
8500 identifier with static linkage.
8501
8502 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8503
8504 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8505 GC.
8506
8507 2011-11-06 Eli Zaretskii <eliz@gnu.org>
8508
8509 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8510 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8511 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8512 return Qleft_to_right.
8513
8514 2011-11-06 Chong Yidong <cyd@gnu.org>
8515
8516 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8517 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8518 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8519 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8520 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8521 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8522 (Fwindow_vscroll): Doc fix.
8523 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8524 argument, since it makes no sense to pass a live window and for
8525 consistency with window-child.
8526
8527 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8528
8529 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8530 support MSVC.
8531
8532 2011-11-05 Jason Rumney <jasonr@gnu.org>
8533
8534 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8535 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8536 fonts (Bug#6029).
8537 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8538 bitwise arithmetic preventing use of unicode-sip and non-truetype
8539 opentype fonts.
8540
8541 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8542
8543 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8544 "emacs"-only part.
8545
8546 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8547 initialization code to keep similarity to xfns.c after changes
8548 from 2011-11-05.
8549
8550 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8551
8552 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8553 (unwind_create_frame): New function (Bug#9943).
8554 (Fx_create_frame): Restructure code to be more similar to the one in
8555 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8556 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8557 Move terminal->reference_count++ just before making the frame official
8558 (Bug#9943).
8559
8560 * nsterm.m (x_free_frame_resources): New function.
8561 (x_destroy_window): Move code to x_free_frame_resources.
8562
8563 * xfns.c (unwind_create_frame): Fix comment.
8564 (Fx_create_frame, x_create_tip_frame):
8565 Move terminal->reference_count++ just before making the frame
8566 official. Move initialization of image_cache_refcount and
8567 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8568
8569 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8570
8571 Support MSVC build with newer versions of Visual Studio.
8572 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8573 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8574 nt/gmake.defs.
8575
8576 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8577 which are not supported by MSVC.
8578 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8579 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8580 bitfields.
8581 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8582 types in bitfields.
8583 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8584
8585 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8586
8587 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
8588
8589 Support MSVC build with newer versions of Visual Studio.
8590 * w32.c: Don't include w32api.h for MSVC.
8591 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8592
8593 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8594 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8595 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8596 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8597 e_* cousins.
8598 (alloca) [_MSC_VER]: Define to _alloca.
8599
8600 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8601
8602 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8603
8604 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8605
8606 * xdisp.c (note_mouse_highlight): If either of
8607 previous/next-single-property-change returns nil, treat that as
8608 the beginning or the end of the buffer. (Bug#9955)
8609
8610 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8611
8612 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
8613 label is not null (Bug#9951).
8614 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8615 may be NULL.
8616
8617 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8618
8619 * window.c (Fwindow_body_size): Mention in the doc string that the
8620 return value is in frame's canonical units. (Bug#9949)
8621
8622 2011-11-03 Eli Zaretskii <eliz@gnu.org>
8623
8624 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8625
8626 * w32fns.c (unwind_create_frame): If needed, free the glyph
8627 matrices of the partially constructed frame. (Bug#9943)
8628 * xfns.c (unwind_create_frame): Likewise.
8629
8630 2011-11-01 Eli Zaretskii <eliz@gnu.org>
8631
8632 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8633 Don't stop backward scan on the continuation glyph, even though
8634 its CHARPOS is positive.
8635 (mouse_face_from_buffer_pos, note_mouse_highlight):
8636 Rename cover_string to disp_string.
8637
8638 2011-11-01 Martin Rudalics <rudalics@gmx.at>
8639
8640 * window.c (temp_output_buffer_show): Don't use
8641 Vtemp_buffer_show_specifiers.
8642 (Vtemp_buffer_show_specifiers): Remove unused variable.
8643
8644 2011-10-30 Eli Zaretskii <eliz@gnu.org>
8645
8646 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8647 past the beginning of the current glyph matrix.
8648
8649 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
8650
8651 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8652 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8653 HAVE_GTK3 (Bug#9869).
8654
8655 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8656 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8657
8658 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8659
8660 * xterm.c: Declare x_handle_net_wm_state to return int.
8661 (handle_one_xevent): Check if we are iconified but don't have
8662 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8663 (get_current_wm_state): Return non-zero if not hidden,
8664 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8665 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8666 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8667 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8668
8669 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8670
8671 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8672 so that this new function doesn't get optimized away by a
8673 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8674
8675 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8676
8677 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8678
8679 2011-10-29 Eli Zaretskii <eliz@gnu.org>
8680
8681 Fix the `xbytecode' command.
8682 * .gdbinit (xprintbytestr): New command.
8683 (xwhichsymbols): Rename from `which'; all callers changed.
8684 (xbytecode): Print the byte-code string as well.
8685
8686 2011-10-29 Kim Storm <storm@cua.dk>
8687
8688 * alloc.c (which_symbols): New function.
8689
8690 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8691
8692 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8693 line. (Bug#9903)
8694
8695 2011-10-29 Glenn Morris <rgm@gnu.org>
8696
8697 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8698 Not clear what it was for, and it causes various bugs. (Bug#9839)
8699
8700 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8701
8702 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8703 possible random value that matches one of those tested as
8704 condition to clear the mouse face.
8705
8706 2011-10-28 Chong Yidong <cyd@gnu.org>
8707
8708 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8709
8710 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8711
8712 * window.c (make_window): Initialize phys_cursor_on_p.
8713
8714 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8715
8716 * lisp.h (struct Lisp_Symbol): Update comments.
8717
8718 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
8719
8720 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8721
8722 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8723
8724 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8725 <oslsachem@gmail.com> for helping to debug this.
8726
8727 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8728 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8729 (g_b_init_get_glyph_outline_w): New static variables.
8730 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8731 (GetGlyphOutlineW_Proc): New typedefs.
8732 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
8733 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8734 New functions.
8735 (w32font_open_internal, compute_metrics):
8736 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
8737 instead of calling the "wide" APIs directly.
8738
8739 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8740
8741 * w32.h (syms_of_w32font): Add prototype.
8742
8743 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8744
8745 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8746 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8747 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8748 (Fmove_to_window_line): Doc fix.
8749
8750 2011-10-27 Chong Yidong <cyd@gnu.org>
8751
8752 * process.c (make_process): Set gnutls_state to NULL.
8753
8754 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8755 non-NULL, regardless of GNUTLS_INITSTAGE.
8756 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8757 an error. Set process slots as soon as we allocate them.
8758
8759 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8760
8761 2011-10-27 Chong Yidong <cyd@gnu.org>
8762
8763 * gnutls.c (emacs_gnutls_deinit): New function.
8764 Deallocate credentials structures as well as calling gnutls_deinit.
8765 (Fgnutls_deinit, Fgnutls_boot): Use it.
8766
8767 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8768 (deactivate_process): Call emacs_gnutls_deinit.
8769
8770 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8771
8772 * image.c (x_create_x_image_and_pixmap):
8773 * w32.c (sys_rename, w32_delayed_load):
8774 * w32font.c (fill_in_logfont):
8775 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8776
8777 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
8778
8779 * w32fns.c (w32_default_color_map): New function,
8780 extracted from Fw32_default_color_map.
8781 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
8782
8783 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8784
8785 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8786
8787 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8788
8789 * keyboard.c (test_undefined): New function (bug#9751).
8790 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8791
8792 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8793
8794 * sysdep.c (init_sys_modes): Fix the check for the controlling
8795 terminal (Bug#6649).
8796
8797 2011-10-20 Eli Zaretskii <eliz@gnu.org>
8798
8799 * dispextern.h (struct bidi_it): New member next_en_type.
8800
8801 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8802 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8803 current character, check also for next_en_type being WEAK_EN.
8804 (bidi_resolve_weak): Don't enter the expensive loop if the current
8805 position is before next_en_pos. Record the bidi type of the first
8806 non-ET, non-BN character we find, in addition to its position.
8807 (bidi_level_of_next_char): Invalidate next_en_type when
8808 next_en_pos is over-stepped.
8809
8810 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8811
8812 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8813 * editfns.c: Rewrite current-time-zone so that it invokes
8814 the equivalent of (format-time-string "%Z") to get the time zone name.
8815 This fixes a bug when the time zone name contains characters that
8816 need converting from the system time locale to Emacs internal format.
8817 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8818 that patch fixed format-time-string to do the conversion, but
8819 I forgot to fix current-time-zone.
8820 (format_time_string): New function, containing most of
8821 what Fformat_time_string used to contain.
8822 (Fformat_time_string): Rewrite in terms of format_time_string.
8823 This doesn't change this function's behavior.
8824 (current-time-zone): Rewrite to use format_time_string.
8825 This fixes the bug reported by Michael Schierl in
8826 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8827 Jason Rumney's 2007-06-07 change worked around this bug, but
8828 didn't fix it.
8829 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8830
8831 2011-10-19 Eli Zaretskii <eliz@gnu.org>
8832
8833 * xdisp.c (start_display): If the character at POS is displayed
8834 via a display vector, reset IT->current.dpvec_index to zero.
8835 (try_window_reusing_current_matrix): If a line ends in a display
8836 vector or the next line starts in a display vector, continue
8837 redrawing the window even though the character position of
8838 start_row was reached.
8839 (Bug#9771, part 2)
8840
8841 2011-10-18 Chong Yidong <cyd@gnu.org>
8842
8843 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8844 with nobreak-char-display too.
8845
8846 2011-10-18 Eli Zaretskii <eliz@gnu.org>
8847
8848 Fix part 3 of bug#9771.
8849 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8850 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8851 non-neutral characters if the current character is a paragraph
8852 separator (a.k.a. Newline). This avoids running the same
8853 expensive loop twice, once when we consume the preceding newline
8854 and the other time when the line actually needs to be displayed.
8855 Avoid the loop when we see neutrals on the base embedding level
8856 following a character whose directionality is the same as the
8857 paragraph's. This avoids running the expensive loop when a line
8858 ends in a long sequence of neutrals, like control characters.
8859 Add assertion against STRONG_AL type. Slightly rearrange code
8860 that determines the type of a neutral given the first non-neutral
8861 that follows it.
8862 (bidi_level_of_next_char): Set next_en_pos to zero when
8863 invalidating its info.
8864
8865 2011-10-17 Eli Zaretskii <eliz@gnu.org>
8866
8867 * xdisp.c (push_display_prop): Determine whether to record string
8868 or buffer position by IT->string, not by IT->method. Allow
8869 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
8870 (move_it_vertically_backward): Don't look for character position
8871 immediately after the newline when in a continuation line.
8872 (Bug#9771, part 1)
8873
8874 2011-10-15 Martin Rudalics <rudalics@gmx.at>
8875
8876 * window.c (coordinates_in_window): Rewrite and delabelize
8877 vertical border check. (Bug#5357) (Bug#9618)
8878
8879 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8880
8881 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8882 errors in XSetWindowBorder (bug#9310).
8883
8884 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8885
8886 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8887 avoid crash when xmalloc overrun checking is enabled.
8888
8889 2011-10-13 Eli Zaretskii <eliz@gnu.org>
8890
8891 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8892 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8893 cursor motion with <left> and <right> arrow keys.
8894
8895 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8896 some callers set that themselves.
8897
8898 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8899
8900 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8901 display string and the previous row comes from the same string and
8902 is empty. (Bug#9739) (Bug#9738)
8903
8904 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8905
8906 * doc.c (get_doc_string): Encode file name (bug#9735).
8907
8908 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8909
8910 * bidi.c (bidi_level_of_next_char):
8911 * xdisp.c (get_visually_first_element): Remove old incorrect
8912 comments regarding the Unicode Line Separator character.
8913
8914 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8915
8916 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8917
8918 * alloc.c (Fgc_status): Do not access beyond zombies array
8919 boundary if nzombies > MAX_ZOMBIES.
8920 * alloc.c (dump_zombies): Add missing format specifier.
8921
8922 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8923
8924 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8925 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8926
8927 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8928 Some packages use them to denote characters with modifiers.
8929
8930 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8931
8932 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8933 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8934 matching a pp-number. Rename parameter var to var1.
8935
8936 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8937
8938 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8939
8940 2011-10-08 Glenn Morris <rgm@gnu.org>
8941
8942 * callint.c (Fcall_interactively): Give a more explicit error for the
8943 'c' case with a non-character input. (Bug#8479)
8944
8945 2011-10-08 Eli Zaretskii <eliz@gnu.org>
8946
8947 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8948 lines.
8949 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8950 lines that are hscrolled on the left.
8951
8952 * dispnew.c (buffer_posn_from_coords): Account for a possible
8953 presence of header-line. (Bug#4426)
8954
8955 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8956
8957 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8958 Don't advertise functionality which we discourage or doesn't work.
8959
8960 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8961
8962 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8963 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8964 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8965 this makes Emacs dump core during garbage collection on rare
8966 occasions. sizeof is obviously inferior to offsetof here, so
8967 stick with offsetof.
8968 (GC_POINTER_ALIGNMENT): New macro.
8969 (mark_memory): Omit 3rd (offset) arg; caller changed.
8970 Don't assume EMACS_INT alignment is the same as pointer alignment.
8971
8972 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8973
8974 * keyboard.c (read_key_sequence_remapped): New var.
8975 (read_key_sequence): Compute remapping in the right buffer.
8976 (command_loop_1): Use read_key_sequence's remapping directly.
8977
8978 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8979
8980 * dired.c (file_name_completion): Don't expand file name.
8981 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8982 before checking file name handler.
8983
8984 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8985 they've been requested explicitly (bug#9591).
8986
8987 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
8988
8989 * keymap.c (Fsingle_key_description): Use make_specified_string
8990 instead of build_string to build string from push_key_description.
8991 (Bug#5193)
8992
8993 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8994
8995 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8996 This fixes a Y2038 bug on 64-bit hosts.
8997 * buffer.c (reset_buffer):
8998 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8999 (Fclear_buffer_auto_save_failure):
9000 Use 0, not -1, to represent an unset failure time, since time_t
9001 might not be signed.
9002
9003 Remove dependency on glibc malloc internals.
9004 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9005 Move back here from lisp.h, but with their new implementations.
9006 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9007 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9008 * charset.c (charset_table_init): New static var.
9009 (syms_of_charset): Use it instead of xmalloc. This removes a
9010 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9011 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9012 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9013 Move back to alloc.c.
9014 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9015 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9016
9017 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9018
9019 * nsterm.m (windowDidResize): Call x_set_window_size only when
9020 ns_in_resize is true. Otherwise set pixelwidth/height and
9021 call change_frame_size (Bug#9628).
9022
9023 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9024
9025 Port --enable-checking=all to Fedora 14 x86-64.
9026 * charset.c (syms_of_charset): Also account for glibc malloc's
9027 internal overhead when calculating the initial malloc maximum.
9028
9029 Port --enable-checking=all to Fedora 14 x86.
9030 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9031 Move to lisp.h.
9032 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9033 (overrun_check_realloc, overrun_check_free):
9034 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9035 That way, xmalloc returns a properly-aligned pointer even if
9036 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9037 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9038 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9039 into account when calculating the initial malloc maximum.
9040 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9041 Move here from alloc.c, so that charset.c can use it too.
9042 Properly align; the old code wasn't right for common 32-bit hosts
9043 when configured with --enable-checking=all.
9044 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9045 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9046
9047 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9048
9049 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9050 use EDOM.
9051
9052 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9053
9054 * xdisp.c (compute_display_string_end): If there's no display
9055 string at CHARPOS, return -1.
9056
9057 * bidi.c (bidi_fetch_char): When compute_display_string_end
9058 returns a negative value, treat the character as a normal
9059 character not covered by a display string. (Bug#9624)
9060
9061 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9062
9063 * lread.c (Fread_from_string): Fix typo in docstring.
9064
9065 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9066
9067 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9068 newline, reseat the iterator instead of bidi-iterating there one
9069 character at a time. (Bug#9610)
9070 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9071 TO_CHARPOS if the bidi iterator is at base embedding level.
9072
9073 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9074
9075 * lread.c (readevalloop): Use correct code for NBSP.
9076 (read1): Likewise. (Bug#9608)
9077
9078 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9079
9080 * dbusbind.c (Fdbus_register_signal): When service is not
9081 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9082
9083 2011-09-25 Glenn Morris <rgm@gnu.org>
9084
9085 * buffer.c (truncate-lines): Doc fix.
9086
9087 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9088
9089 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9090 (Fset_window_next_buffers): Doc fix.
9091
9092 2011-09-24 Glenn Morris <rgm@gnu.org>
9093
9094 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9095
9096 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9097
9098 Fix minor problems found by static checking.
9099 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9100 * indent.c (Fvertical_motion): Fix == vs = typo.
9101
9102 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9103
9104 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9105 Default value is now t. Doc fix.
9106
9107 * indent.c (Fvertical_motion): Compute and apply the overshoot
9108 logic when moving up, not only when moving down. Fix the
9109 confusing name and values of the it_overshoot_expected variable;
9110 logic changes accordingly. (Bug#9254) (Bug#9549)
9111
9112 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9113 CHARPOS is covered by a display string which includes newlines.
9114 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9115 is covered by a display string with embedded newlines.
9116
9117 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9118
9119 * dbusbind.c (Fdbus_register_signal): Add match rule to
9120 Vdbus_registered_objects_table. (Bug#9581)
9121 (Fdbus_register_method, Vdbus_registered_objects_table):
9122 Fix docstring.
9123
9124 2011-09-24 Jim Meyering <meyering@redhat.com>
9125
9126 do not ignore write error for any output size
9127 The previous change was incomplete.
9128 While it makes emacs --batch detect the vast majority of stdout
9129 write failures, errors were still ignored whenever the output size is
9130 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9131 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9132 && echo FAIL: ignored write error
9133 FAIL: ignored write error
9134 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9135 && echo FAIL: ignored write error
9136 FAIL: ignored write error
9137 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9138
9139 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9140
9141 * emacs.c (Fkill_emacs): In noninteractive mode exit
9142 non-successfully if a write error occurred on stdout. (Bug#9574)
9143
9144 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9145
9146 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9147 the xassert test.
9148
9149 * dispextern.h (struct it): Update the comment documenting what
9150 can it->OBJECT be.
9151
9152 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9153
9154 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9155 a display string, extend search for cursor position to end of row.
9156 (find_row_edges): If the row ends in a newline from a display
9157 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9158 Handle the case of a display string with multiple newlines.
9159 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9160 non-empty line. Fixes confusing cursor motion with arrow keys at
9161 the beginning of a line that starts with whitespace.
9162
9163 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9164
9165 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9166 (bug#9493).
9167
9168 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9169
9170 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9171 boolean (Bug#9154).
9172
9173 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9174
9175 * xdisp.c (display_line): Record maximum and minimum buffer
9176 positions even if no glyphs were produced (e.g., by a zero-width
9177 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9178 buffer positions that will be removed from the glyph row because
9179 they don't fit.
9180 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9181 column is beyond frame width: don't subtract 1 "pixel" when
9182 computing width of the stretch.
9183 (reseat_at_next_visible_line_start): Undo the change made on
9184 2011-09-17 that saved paragraph information and restored it after
9185 the call to `reseat'. (Bug#9545)
9186
9187 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9188
9189 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9190 and turn window cursor on if cleared (Bug#9415).
9191
9192 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9193
9194 * search.c (boyer_moore): Take unibyte characters from pattern
9195 literally. (Bug#9458)
9196
9197 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9198
9199 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9200
9201 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9202
9203 Fix minor problem found by static checking.
9204 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9205 initialized, to pacify gcc -Wuninitialized.
9206
9207 * fileio.c: Report proper errno when syscall falls.
9208 (Finsert_file_contents): Save and restore errno,
9209 so that report_file_error outputs the correct diagnostic.
9210 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9211
9212 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9213
9214 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9215
9216 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9217
9218 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9219 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9220
9221 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9222
9223 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9224 about the current paragraph and restore it after the call to reseat.
9225
9226 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9227 (bidi_find_paragraph_start): Search back for paragraph beginning
9228 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9229 (bidi_move_to_visually_next): Only trigger paragraph-related
9230 computations when the last character is a newline or at EOB, not
9231 just any NEUTRAL_B. (Bug#9470)
9232
9233 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9234 truncated lines if point is covered by a display string. (Bug#9524)
9235
9236 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9237
9238 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9239 (cons_to_x_long): New function.
9240 (lisp_data_to_selection_data): Use it. Correct the test for
9241 short-versus-long data; it was negated. Break out of vector
9242 loop, for efficiency, when a long datum is discovered.
9243
9244 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9245
9246 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9247
9248 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9249
9250 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9251 GCC PR/17406) by declaring this function with external scope.
9252
9253 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9254
9255 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9256 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9257
9258 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9259
9260 * editfns.c (Fformat): Correctly handle text properties on "%%".
9261
9262 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9263
9264 * xterm.c (x_draw_composite_glyph_string_foreground):
9265 * w32term.c (x_draw_composite_glyph_string_foreground):
9266 * term.c (encode_terminal_code):
9267 * composite.c (composition_update_it, get_composition_id):
9268 * xdisp.c (get_next_display_element)
9269 (fill_composite_glyph_string): Add comments about special meaning
9270 of TAB characters in a composition.
9271
9272 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9273
9274 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9275 This occurs when processing a multibyte format.
9276 Problem reported by Wolfgang Jenker.
9277
9278 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9279
9280 * xdisp.c (try_cursor_movement): Only check for exact match if
9281 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9282
9283 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9284
9285 Remove unused external symbols.
9286 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9287 * xdisp.c (calc_pixel_width_or_height): Now static.
9288 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9289 * indent.c (check_display_width):
9290 * w32term.c: Fix comment to match code.
9291 * xterm.c, xterm.h (x_catching_errors): Remove.
9292
9293 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9294
9295 * xselect.c: Use signed conversions more consistently (Bug#9498).
9296 (selection_data_to_lisp_data): Assume incoming selection data are
9297 signed integers, not unsigned. This is to be consistent with
9298 outgoing selection data, which was modified to use signed integers
9299 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9300 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9301 expects long, not unsigned long.
9302
9303 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9304
9305 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9306 computation of loop end. Reported by Johan Bockgård
9307 <bojohan@gnu.org>.
9308
9309 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9310
9311 * frame.c (Fother_visible_frames_p): Function deleted.
9312
9313 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9314
9315 * indent.c (compute_motion): Process display vector front to back
9316 rather than the other way around. (Bug#2496)
9317
9318 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9319
9320 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9321
9322 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9323
9324 * minibuf.c (Fread_from_minibuffer): Doc fix.
9325
9326 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9327
9328 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9329 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9330
9331 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9332
9333 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9334 value for non-existent files.
9335
9336 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9337
9338 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9339 set its "size" to -1. This will set the modtime_size field of
9340 the corresponding buffer to -1, which is what
9341 verify-visited-file-modtime expects for files that do not exist.
9342 (Bug#9139)
9343
9344 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9345
9346 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9347 here ...
9348 * lisp.h: ... from here. push_key_description is no longer
9349 defined in keyboard.c, so its declaration should not be in
9350 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9351 logically belongs with push_key_description.
9352
9353 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9354
9355 * buffer.h: Include <sys/types.h> instead of <time.h>.
9356 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9357 Problem reported by Herbert J. Skuhra.
9358
9359 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9360
9361 * xml.c (parse_region): Make the parsing work for
9362 non-comment-starting XML files again (bug#9144).
9363
9364 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9365
9366 * image.c (gif_load): Fix calculation of bottom and right corner.
9367 (Bug#9468)
9368
9369 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9370
9371 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9372 redisplay in small windows.
9373
9374 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9375
9376 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9377
9378 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9379
9380 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9381 Operate on live windows only.
9382
9383 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
9384
9385 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9386
9387 2011-09-07 Eli Zaretskii <eliz@gnu.org>
9388
9389 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9390 only under bidi iteration.
9391
9392 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9393
9394 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9395
9396 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9397
9398 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9399 Without this fix, the command to link temacs failed due to an
9400 undefined symbol __builtin_isnan. This is because
9401 /usr/include/iso/math_c99.h #defines isnan(x) to
9402 __builtin_isnan(x), but the bundled gcc, which identifies itself
9403 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9404 a __builtin_isnan.
9405 * floatfns.c (isnan): #undef, and then #define to a clone of
9406 what's in data.c.
9407 (Fisnan): Always define, since it's always available now.
9408 (syms_of_floatfns): Always define isnan at the Lisp level.
9409
9410 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9411
9412 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9413
9414 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9415
9416 * fileio.c: Fix bugs with large file offsets (Bug#9428).
9417 The previous code assumed that file offsets (off_t values) fit in
9418 EMACS_INT variables, which is not true on typical 32-bit hosts.
9419 The code messed up by falsely reporting buffer overflow in cases
9420 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9421 when "big" contains more than 2**29 bytes, even though this
9422 inserts just one byte and does not overflow the buffer.
9423 (Finsert_file_contents): Store file offsets as off_t
9424 values, not as EMACS_INT values. Check for overflow when
9425 converting between EMACS_INT and off_t. When checking for
9426 buffer overflow or for overlap, take the offsets into account.
9427 Don't use EMACS_INT for small values where int suffices.
9428 When checking for overlap, fix a typo: ZV was used where
9429 ZV_BYTE was intended.
9430 (Fwrite_region): Don't assume off_t fits into 'long'.
9431 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9432
9433 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
9434
9435 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9436
9437 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9438
9439 sprintf-related integer and memory overflow issues (Bug#9412).
9440
9441 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
9442 (esprintf, exprintf, evxprintf): New functions.
9443 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
9444 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
9445 (modify_event_symbol): Do not assume that the length of
9446 name_alist_or_stem is safe to alloca and fits in int.
9447 (Fexecute_extended_command): Likewise for function name and binding.
9448 (Frecursion_depth): Wrap around reliably on integer overflow.
9449 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9450 since some callers pass EMACS_INT values.
9451 (Fsingle_key_description): Don't crash if symbol name contains more
9452 than MAX_ALLOCA bytes.
9453 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9454 (get_minibuffer): Arg is now EMACS_INT, not int.
9455 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
9456 (esprintf, exprintf, evxprintf): New decls.
9457 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9458
9459 * dbusbind.c (signature_cat): New function.
9460 (xd_signature, Fdbus_register_signal):
9461 Do not overrun buffer; instead, report string overflow.
9462
9463 * dispnew.c (add_window_display_history): Don't overrun buffer.
9464 Truncate instead; this is OK since it's just a log.
9465
9466 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9467 even if the time zone offset is outlandishly large.
9468 Don't mishandle offset == INT_MIN.
9469
9470 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9471 when creating daemon; the previous buffer-overflow check was incorrect.
9472
9473 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9474 which has the guts of the old verror function.
9475
9476 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9477 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9478
9479 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9480 (font_unparse_xlfd): Don't blindly alloca long strings.
9481 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9482 fits in int, when using sprintf. Use single snprintf to count
9483 length of string rather than counting it via multiple sprintfs;
9484 that's simpler and more reliable.
9485 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9486 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9487 sprintf, in case result does not fit in int.
9488
9489 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9490 (fontset_from_font): Print it.
9491
9492 * frame.c (tty_frame_count): Now printmax_t, not int.
9493 (make_terminal_frame, set_term_frame_name): Print it.
9494 (x_report_frame_params): In X, window IDs are unsigned long,
9495 not signed long, so print them as unsigned.
9496 (validate_x_resource_name): Check for implausibly long names,
9497 and don't assume name length fits in 'int'.
9498 (x_get_resource_string): Don't blindly alloca invocation name;
9499 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9500 not fit in int.
9501
9502 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9503 (xg_check_special_colors, xg_set_geometry):
9504 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9505
9506 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9507 Use esprintf, not sprintf, in case result does not fit in int.
9508
9509 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9510 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9511 it as a large positive number.
9512 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9513 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9514
9515 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9516 in case result does not fit in int.
9517
9518 * print.c (float_to_string): Detect width overflow more reliably.
9519 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9520 buffer overrun. Don't assume list length fits in 'int'. Treat
9521 print length of 0 as 0, not as infinity; to be consistent with other
9522 uses of print length in this function. Don't overflow print length
9523 index. Don't assume hash table size fits in 'long', or that
9524 vectorlike size fits in 'unsigned long'.
9525
9526 * process.c (make_process): Use printmax_t, not int, to format
9527 process-name gensyms.
9528
9529 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9530
9531 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9532 to avoid potential buffer overrun.
9533
9534 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9535 if X resource line is longer than 512 bytes.
9536
9537 * xfns.c (x_window): Make sprintf buffer a bit bigger
9538 to avoid potential buffer overrun.
9539
9540 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9541
9542 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9543
9544 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9545
9546 Integer overflow fixes for scrolling, etc.
9547 Without these, Emacs silently mishandles large integers sometimes.
9548 For example, "C-u 4294967297 M-x recenter" was treated as if
9549 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9550
9551 * xdisp.c (try_window_id): Check Emacs fixnum range before
9552 converting to 'int'.
9553
9554 * window.c (window_scroll_line_based, Frecenter):
9555 Check that an Emacs fixnum is in range before assigning it to 'int'.
9556 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9557 values converted from Emacs fixnums.
9558 (Frecenter): Don't wrap around a line count if it is out of 'int'
9559 range; instead, treat it as an extreme value.
9560 (Fset_window_configuration, compare_window_configurations):
9561 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9562
9563 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9564 that can exceed INT_MAX. Check that EMACS_INT value is in range
9565 before assigning it to the (possibly-narrower) index.
9566 (match_limit): Don't assume that a fixnum can fit in 'int'.
9567
9568 * print.c (print_object): Use ptrdiff_t, not int, for index that can
9569 exceed INT_MAX.
9570
9571 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
9572 (Fvertical_motion): Don't wrap around LINES values that don't fit
9573 in 'int'. Instead, treat them as extreme values. This is good
9574 enough for windows, which can't have more than INT_MAX lines anyway.
9575
9576 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9577
9578 * Require libxml/parser.h to avoid compilation warning.
9579
9580 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9581
9582 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9583 since this reportedly can destroy thread storage.
9584
9585 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
9586
9587 * syntax.c (find_defun_start): Update all cache variables if
9588 exiting early (Bug#9401).
9589
9590 2011-08-30 Eli Zaretskii <eliz@gnu.org>
9591
9592 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9593
9594 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9595 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9596 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9597
9598 * term.c (tty_append_glyph): New function.
9599 (produce_stretch_glyph): Static function and its prototype deleted.
9600
9601 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9602 Add prototypes.
9603
9604 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9605
9606 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9607 when checking :margin (Bug#9390).
9608 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
9609 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
9610 so that the name doesn't mislead. All uses changed.
9611
9612 2011-08-28 Johan Bockgård <bojohan@gnu.org>
9613
9614 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9615 set_tty_hooks.
9616
9617 2011-08-27 Eli Zaretskii <eliz@gnu.org>
9618
9619 * xdisp.c (move_it_to): Don't bail out early when reaching
9620 position beyond to_charpos, if we are scanning backwards.
9621 (move_it_vertically_backward): When DY == 0, make sure we get to
9622 the first character in the line after the newline.
9623
9624 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9625
9626 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9627 (ccl_driver): Do not generate an out-of-range pointer.
9628 (Fccl_execute_on_string): Remove unnecessary check for
9629 integer overflow, noted by Stefan Monnier in
9630 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9631 Remove a FIXME that didn't need fixing.
9632 Simplify the newly-introduced buffer reallocation code.
9633
9634 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
9635
9636 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9637
9638 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
9639
9640 Integer and memory overflow issues (Bug#9196).
9641
9642 * doc.c (get_doc_string): Rework so that
9643 get_doc_string_buffer_size is the actual buffer size, rather than
9644 being 1 less than the actual buffer size; this makes xpalloc more
9645 convenient.
9646
9647 * image.c (x_allocate_bitmap_record, cache_image):
9648 * xselect.c (Fx_register_dnd_atom):
9649 Simplify previous changes by using xpalloc.
9650
9651 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9652 since either will do and ptrdiff_t is convenient with xpalloc.
9653
9654 * charset.c (charset_table_size)
9655 (struct charset_sort_data.priority): Now ptrdiff_t.
9656 (charset_compare): Don't overflow if priorities differ greatly.
9657 (Fsort_charsets): Don't assume list length fits in int.
9658 Check for size-calculation overflow when allocating sort data.
9659 (syms_of_charset): Allocate an initial charset table that is
9660 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9661
9662 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9663
9664 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9665 The actual value is always <= INT_MAX, and leaving it unsigned made
9666 overflow checking harder.
9667
9668 * dispextern.h (struct glyph_matrix.rows_allocated)
9669 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9670 with xpalloc. The values are still always <= INT_MAX.
9671
9672 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9673
9674 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9675 (SAFE_NALLOCA): New macro.
9676
9677 * region-cache.c (struct boundary.pos, find_cache_boundary)
9678 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9679 (set_cache_region, invalidate_region_cache)
9680 (revalidate_region_cache, know_region_cache, region_cache_forward)
9681 (region_cache_backward, pp_cache):
9682 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9683 so that ptrdiff_t * can be passed to xpalloc.
9684 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9685 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9686 (pp_cache): Don't assume cache_len fits in int.
9687 * region-cache.h: Adjust extern decls to match.
9688
9689 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9690 EMACS_INT, since either will do, for xpalloc.
9691
9692 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9693 (xnmalloc, xnrealloc, xpalloc): New functions.
9694
9695 * bidi.c (bidi_shelve_header_size): New constant.
9696 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9697 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9698
9699 * bidi.c (bidi_cache_shrink):
9700 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9701 (overlay_strings):
9702 Don't update size of array until after memory allocation succeeds,
9703 because xmalloc/xrealloc may not return.
9704 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9705 now that we have proper integer overflow checking.
9706 (record_overlay_string, overlay_strings): Catch overflows when
9707 calculating size of overlay_str_buf.
9708
9709 * callproc.c (Fcall_process): Check for size overflow when
9710 calculating size of args2.
9711 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9712 Normally we prefer signed values, but sticking with ptrdiff_t would
9713 require adding more-complicated checks.
9714
9715 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9716 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9717 Redo buffer-overflow calculations to avoid integer overflow.
9718 Add a FIXME comment where memory seems to be over-allocated.
9719
9720 * character.c (Fstring): Check for size-calculation overflow.
9721
9722 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9723 unnecessary integer overflow. Check for size overflow.
9724 (encode_coding_object): Don't update size until xmalloc succeeds.
9725
9726 * composite.c (get_composition_id): Check for overflow in glyph
9727 length calculations.
9728
9729 Integer and memory overflow fixes for display code.
9730 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9731 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9732 (scrolling_window): Check for overflow in size calculations.
9733 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9734 Don't assume glyph table len fits in int.
9735 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9736 (row_table_size): Now ptrdiff_t, not int.
9737 (scrolling_window): Avoid overflow in size calculations.
9738 Don't update size until allocation succeeds.
9739 * fns.c (concat): Check for overflow in size calculations.
9740 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9741 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9742 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9743
9744 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9745 (get_doc_string): Check for size calculation overflow.
9746 Don't update size until allocation succeeds.
9747 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9748 EMACS_INT, where ptrdiff_t will do.
9749 (Fsubstitute_command_keys): Check for string overflow.
9750
9751 * editfns.c (set_time_zone_rule): Don't assume environment length
9752 fits in int.
9753 (message_length): Now ptrdiff_t, not int.
9754 (Fmessage_box): Don't update size until allocation succeeds.
9755 Don't assume message length fits in int.
9756 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9757
9758 * emacs.c (main): Do not reallocate argv, since there is a null at
9759 the end that can be overwritten, and this way there's no need to
9760 worry about size-calculation overflow.
9761 (sort_args): Check for size-calculation overflow.
9762
9763 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9764 alloc succeeds.
9765 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9766
9767 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9768 (x_set_scroll_bar_width, x_figure_window_size):
9769 Check for integer overflow.
9770 (x_set_alpha): Do not assume XINT fits in int.
9771
9772 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9773 This is for the members text_lines, text_cols, total_lines, total_cols,
9774 where the system imposes an 'int' limit.
9775
9776 * fringe.c (Fdefine_fringe_bitmap):
9777 Don't update size until alloc works.
9778
9779 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9780 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9781
9782 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9783 Check for size-calculation overflow.
9784 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9785 do, as we prefer signed integers.
9786 (id_to_widget.max_size, id_to_widget.used)
9787 (xg_store_widget_in_map, xg_remove_widget_from_map)
9788 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9789 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9790 Use and return ptrdiff_t, not int.
9791 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9792 * gtkutil.h: Change prototypes to match the above.
9793
9794 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9795 are duplicate now that they've been promoted to lisp.h.
9796 (x_allocate_bitmap_record, x_alloc_image_color)
9797 (make_image_cache, cache_image, xpm_load):
9798 Don't update size until alloc is done.
9799 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9800 (x_detect_edges):
9801 Check for size calculation overflow.
9802 (ct_colors_allocated_max): New constant.
9803 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9804 overflow.
9805
9806 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9807 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9808 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9809 Use ptrdiff_t, not int, to count maps.
9810 (read_char_minibuf_menu_prompt): Check for overflow in size
9811 calculations. Don't update size until allocation succeeds.
9812 Redo calculations to avoid overflow.
9813 * keyboard.h: Change prototypes to match the above.
9814
9815 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9816 to count maps.
9817 (current_minor_maps): Check for size calculation overflow.
9818 * keymap.h: Change prototypes to match the above.
9819
9820 * lread.c (read1, init_obarray): Don't update size until alloc done.
9821
9822 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9823 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9824
9825 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9826 Now ptrdiff_t, not int.
9827 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9828 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9829
9830 * process.c (Fnetwork_interface_list): Check for overflow
9831 in size calculation.
9832
9833 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9834
9835 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9836 overflow. Don't bother calling xmalloc when xrealloc will do.
9837
9838 * search.c (Freplace_match): Check for size calculation overflow.
9839 (Fset_match_data): Don't assume list lengths fit in 'int'.
9840
9841 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9842 for command line length. Do not attempt to address one before the
9843 beginning of an array, as that's not portable.
9844
9845 * term.c (max_frame_lines): Remove; unused.
9846 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9847 not int.
9848 (encode_terminal_code, calculate_costs): Check for size
9849 calculation overflow.
9850 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9851 table lengths and related sizes. Don't update size until alloc
9852 done. Redo calculations to avoid overflow.
9853 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9854
9855 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9856 subtracting pointers.
9857 (gobble_line): Check for overflow more carefully. Don't update size
9858 until alloc done.
9859
9860 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9861 Don't update size until alloc done.
9862 Redo size calculations to avoid overflow.
9863 Check for size calculation overflow.
9864 (main) [DEBUG]: Fix typo in invoking tparam1.
9865
9866 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9867 Use ptrdiff_t, not int, for sizes.
9868 (store_mode_line_noprop_char): Don't update size until alloc done.
9869
9870 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9871 Use ptrdiff_t, not int, for sizes.
9872 (Finternal_make_lisp_face, cache_face):
9873 Check for size calculation overflow.
9874 (cache_face): Treat size calculation overflows as if they were
9875 memory exhaustion (the usual treatment), rather than aborting.
9876
9877 * xfns.c (x_encode_text, x_set_name_internal)
9878 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9879 sizes, since they can exceed INT_MAX in size. Check for size
9880 calculation overflow.
9881
9882 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9883 (xg_select): Check for size calculation overflow.
9884 Don't update size until alloc done.
9885
9886 * xrdb.c (get_environ_db): Don't assume path length fits in int,
9887 as sprintf is limited to int lengths.
9888
9889 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9890 (X_LONG_MIN): New macros.
9891 Use them to make the following changes clearer.
9892 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9893 This change doesn't affect the value now, but it may help remind
9894 future maintainers not to raise the value too much later.
9895 (SELECTION_QUANTUM): Remove, replacing with ...
9896 (selection_quantum): ... new function, which avoids overflow.
9897 All uses changed.
9898 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9899 assumption that selection length fits in 'int'.
9900 (x_reply_selection_request, x_handle_selection_request)
9901 (x_get_window_property, receive_incremental_selection)
9902 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9903 (lisp_data_to_selection_data, clean_local_selection_data):
9904 Use ptrdiff_t, not int, to record length of selection.
9905 (x_reply_selection_request, x_get_window_property)
9906 (receive_incremental_selection, x_property_data_to_lisp):
9907 Redo calculations to avoid overflow.
9908 (x_reply_selection_request): When sending hint, ceiling it at
9909 X_LONG_MAX rather than relying on wraparound overflow to send
9910 something.
9911 (x_get_window_property, receive_incremental_selection)
9912 (lisp_data_to_selection_data, x_property_data_to_lisp):
9913 Check for size-calculation overflow.
9914 (x_get_window_property, receive_incremental_selection)
9915 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9916 Don't store size until memory allocation succeeds.
9917 (x_get_window_property): Plug memory leak on memory exhaustion.
9918 Don't double-block input; malloc is safe here. Don't assume 2**34
9919 - 4 fits in unsigned long. Add an xassert to check
9920 XGetWindowProperty overflow. Be more careful about overflow
9921 calculations, and distinguish size from memory overflow better.
9922 (receive_incremental_selection): When tracing, don't assume
9923 unsigned int is less than INT_MAX.
9924 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9925 harmful) conversions of unsigned short to int.
9926 (lisp_data_to_selection_data): Don't assume that integers
9927 in the range -65535 through -1 fit in an X unsigned short.
9928 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9929 result parameters unless successful. Rely on cons_to_unsigned
9930 to report problems with elements; the old code wasn't right anyway.
9931 (x_check_property_data): Check for int overflow; we cannot use
9932 a wider type due to X limits.
9933 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9934
9935 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
9936
9937 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9938 (x_term_init): Check for size calculation overflow.
9939 (x_color_cells): Don't store size until memory allocation succeeds.
9940 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
9941 Don't assume alloca size is less than MAX_ALLOCA.
9942 (x_term_init): Don't assume length fits in int (sprintf is limited
9943 to int size).
9944
9945 Use ptrdiff_t for composition IDs.
9946 * character.c (lisp_string_width):
9947 * composite.c (composition_table_size, n_compositions)
9948 (get_composition_id, composition_gstring_from_id):
9949 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9950 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9951 * window.c (Frecenter):
9952 Use ptrdiff_t, not int, for composition IDs.
9953 * composite.c (get_composition_id): Check for integer overflow.
9954 * composite.h: Adjust prototypes to match the above changes.
9955
9956 Use ptrdiff_t for hash table indexes.
9957 * category.c (hash_get_category_set):
9958 * ccl.c (ccl_driver):
9959 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9960 * coding.c (coding_system_charset_list, detect_coding_system):
9961 * coding.h (struct coding_system.id):
9962 * composite.c (get_composition_id, gstring_lookup_cache):
9963 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9964 * image.c (xpm_get_color_table_h):
9965 * lisp.h (hash_lookup, hash_put):
9966 * minibuf.c (Ftest_completion):
9967 Use ptrdiff_t for hash table indexes, not int (which is too
9968 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9969 32-bit --with-wide-int hosts).
9970
9971 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9972 Add a FIXME comment about memory leaks.
9973 (syms_of_charset): Don't assume xmalloc returns.
9974
9975 Don't assume that stated character widths fit in int.
9976 * character.c (Fchar_width, c_string_width, lisp_string_width):
9977 * character.h (CHAR_WIDTH):
9978 * indent.c (MULTIBYTE_BYTES_WIDTH):
9979 Use sanitize_char_width to avoid undefined and/or bad behavior
9980 with outlandish widths.
9981 * character.h (sanitize_tab_width): Rename from sanitize_width,
9982 now that we have two such functions. All uses changed.
9983 (sanitize_char_width): New inline function.
9984
9985 Don't assume that tab-width fits in int.
9986 * character.h (sanitize_width): New inline function.
9987 (SANE_TAB_WIDTH): New macro.
9988 (ASCII_CHAR_WIDTH): Use it.
9989 * indent.c (sane_tab_width): Remove. All uses replaced by
9990 SANE_TAB_WIDTH (current_buffer).
9991 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9992
9993 * fileio.c: Integer overflow issues with file modes.
9994 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9995
9996 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9997 Remove unreachable code.
9998 (read_hex, load_charset_map_from_file): Check for integer overflow.
9999
10000 * xterm.c: Don't go over XClientMessageEvent limit.
10001 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10002 (x_send_scroll_bar_event): Likewise. Check that the size does not
10003 exceed limits imposed by XClientMessageEvent, as well as the usual
10004 ptrdiff_t and size_t limits.
10005
10006 * keyboard.c: Overflow, signedness and related fixes.
10007 (make_lispy_movement): Use same integer type in forward decl
10008 that is used in the definition.
10009 (read_key_sequence, keyremap_step):
10010 Change bufsize argument back to int, undoing my 2011-03-30 change.
10011 We prefer signed types, and int is wide enough here.
10012 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10013 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10014 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10015 length, not size_t. Use ptrdiff_t for index, not int.
10016 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10017 possibility of integer overflow.
10018
10019 Overflow, signedness and related fixes for images.
10020
10021 * dispextern.h (struct it.stack[0].u.image.image_id)
10022 (struct_it.image_id, struct image.id, struct image_cache.size)
10023 (struct image_cache.used, struct image_cache.ref_count):
10024 * gtkutil.c (update_frame_tool_bar):
10025 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10026 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10027 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10028 * nsmenu.m (update_frame_tool_bar):
10029 * xdisp.c (calc_pixel_width_or_height):
10030 * xfns.c (image_cache_refcount):
10031 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10032 on typical 64-bit hosts.
10033
10034 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10035 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10036 Omit unnecessary casts to int.
10037 (parse_image_spec): Check that integers fall into 'int' range
10038 when the callers expect that.
10039 (image_ascent): Redo ascent calculation to avoid int overflow.
10040 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10041 (lookup_image): Remove unnecessary tests.
10042 (xbm_image_p): Locals are now of int, not EMACS_INT,
10043 since parse_image_check makes sure they fit into int.
10044 (png_load, gif_load, svg_load_image):
10045 Prefer int to unsigned where either will do.
10046 (tiff_handler): New function, combining the cores of the
10047 old tiff_error_handler and tiff_warning_handler.
10048 This function is rewritten to use vsnprintf and thereby avoid
10049 stack buffer overflows. It uses only the features of vsnprintf
10050 that are common to both POSIX and native Microsoft.
10051 (tiff_error_handler, tiff_warning_handler): Use it.
10052 (tiff_load, gif_load, imagemagick_load_image):
10053 Don't assume :index value fits in 'int'.
10054 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10055 (imagemagick_load_image): Check that crop parameters fit into
10056 the integer types that MagickCropImage accepts. Don't assume
10057 Vimagemagick_render_type has a nonnegative value. Don't assume
10058 size_t fits in 'long'.
10059 (gs_load): Use printmax_t to print the widest integers possible.
10060 Check for integer overflow when computing image height and width.
10061
10062 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10063
10064 * xdisp.c (redisplay_window): Don't force window start if point
10065 will be invisible in the resulting window. (Bug#9324)
10066
10067 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10068
10069 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10070 the display spec is of the form `(space ...)'.
10071 (handle_display_spec): Return the value returned by
10072 handle_single_display_spec, not just 1 or zero.
10073 (handle_single_display_spec): If the display spec is of the form
10074 `(space ...)', and specifies display in the text area, return 2
10075 rather than 1.
10076 (try_cursor_movement): Check for the need to scroll more
10077 accurately, and prefer exact match for point under bidi.
10078 Don't advance `row' beyond the last row of the window.
10079
10080 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10081 into disp_prop; all users changed.
10082
10083 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10084 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10085 for the text covered by the display property.
10086
10087 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10088
10089 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10090 Change return value to nil.
10091 (Frecord_buffer): Delete unused function.
10092
10093 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10094
10095 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10096 buffers, return left-to-right.
10097 (set_cursor_from_row): Consider candidate row a win if its glyph
10098 represents a newline and point is on that newline. Fixes cursor
10099 positioning on the newline at EOL of R2L text within L2R
10100 paragraph, and vice versa.
10101 (try_cursor_movement): Check continued rows, in addition to
10102 continuation rows. Fixes unwarranted scroll when point enters a
10103 continued line of R2L text within an L2R paragraph, or vice versa.
10104 (cursor_row_p): Consider the case of point being equal to
10105 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10106 from the end of a short line to the beginning of a continued line
10107 of R2L text within L2R paragraph.
10108 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10109 composed characters.
10110
10111 * bidi.c (bidi_check_type): Use xassert.
10112 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10113 members.
10114
10115 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10116
10117 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10118 a character.
10119
10120 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10121
10122 * nsfont.m (ns_otf_to_script): Fix typo.
10123
10124 2011-08-22 Kenichi Handa <handa@m17n.org>
10125
10126 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10127 extra slot even if the purpose is char-code-property-table.
10128
10129 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10130
10131 * xdisp.c (redisplay_window): When computing centering_position,
10132 account for the height of the header line. (Bug#8874)
10133
10134 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10135 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10136 candidate is selected by the mouse, and that candidate has a
10137 composed character under the mouse.
10138
10139 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10140 coordinates reported by pos-visible-in-window-p for a composed
10141 character in column zero.
10142
10143 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10144
10145 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10146
10147 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10148
10149 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10150 consider it a hit if to_charpos is anywhere in the range of the
10151 composed buffer positions.
10152
10153 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10154
10155 * image.c (gif_load): Don't assume that each subimage has the same
10156 dimensions as the base image. Handle disposal method that is
10157 "undefined" by the gif spec (Bug#9335).
10158
10159 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10160
10161 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10162 (Fcondition_case): Document `debug' symbol in error handler.
10163
10164 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10165
10166 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10167 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10168 from an Org mode buffer to a Speedbar frame.
10169
10170 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10171 a composition, take its buffer position from IT->cmp_it.charpos.
10172 Fixes cursor positioning at the beginning of a line that begins
10173 with a composed character.
10174
10175 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10176
10177 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10178 character bidirectional type, use STRONG_L instead. Fixes crashes
10179 in a buffer produced by `describe-categories'.
10180
10181 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10182 members before the level stack, so they would be saved and
10183 restored when copying iterator state. Fixes incorrect reordering
10184 around TABs covered by display properties.
10185
10186 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10187
10188 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10189
10190 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10191
10192 * eval.c (internal_condition_case, internal_condition_case_1)
10193 (internal_condition_case_2, internal_condition_case_n):
10194 Remove unnecessary aborts (Bug#9081).
10195
10196 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10197
10198 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10199 has no `load' handler, try opening the file locally. (Bug#9311)
10200
10201 2011-08-16 Ken Brown <kbrown@cornell.edu>
10202
10203 * gmalloc.c: Expand comment.
10204
10205 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10206
10207 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10208 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10209
10210 2011-08-16 Ken Brown <kbrown@cornell.edu>
10211
10212 Fix memory allocation problems in Cygwin build (Bug#9273).
10213
10214 * unexcw.c ( __malloc_initialized): Declare external variable.
10215 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10216
10217 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10218 New variables.
10219 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10220 dumped emacs.
10221 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10222 in the static heap.
10223 [CYGWIN] (special_realloc): New function.
10224 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10225 requests to realloc storage in the static heap.
10226
10227 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10228
10229 * bidi.c (bidi_initialize): Remove unused local.
10230
10231 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10232
10233 * bidimirror.h:
10234 * biditype.h: Remove file.
10235 * makefile.w32-in ($(BLD)/bidi.$(O)):
10236 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10237
10238 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10239
10240 * chartab.c: Improve commentary for the uniprop_table API.
10241
10242 * bidi.c (bidi_paragraph_init): Support zero value of
10243 bidi_ignore_explicit_marks_for_paragraph_level.
10244 (bidi_initialize): Use uniprop_table instead of including
10245 biditype.h and bidimirror.h.
10246
10247 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10248 coordinates of the iterator when restoring from ppos_it.
10249 (Bug#9296)
10250
10251 2011-08-14 Kenichi Handa <handa@m17n.org>
10252
10253 * process.c (create_process): Call setup_process_coding_systems
10254 after the pid of the process is set to -1 (Bug#8162).
10255
10256 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10257
10258 * xdisp.c (move_it_in_display_line_to): Don't invoke
10259 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10260 ppos_it. Fixes vertical cursor motion when line beginning is
10261 covered by an image. (Bug#9296)
10262
10263 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10264
10265 * nsterm.h (ns_run_ascript): Declare.
10266 (NSAPP_DATA2_RUNASSCRIPT): Define.
10267
10268 * nsfns.m (as_script, as_result, as_status): New static variables.
10269 (ns_run_ascript): New function.
10270 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10271 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10272 the event loop. Get status from as_status (Bug#7276).
10273
10274 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10275 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10276 the event loop (Bug#7276).
10277
10278 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10279
10280 * gnutls.c (QCgnutls_bootprop_priority)
10281 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10282 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10283 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10284 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10285 (QCgnutls_bootprop_verify_hostname_error)
10286 (QCgnutls_bootprop_callbacks_verify): Rename from
10287 Qgnutls_bootprop_..., all uses changed.
10288
10289 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10290 uses changed.
10291
10292 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10293
10294 * xfaces.c (Qframe_set_background_mode): Now static.
10295 * dispextern.h (Qframe_set_background_mode): Remove decl.
10296
10297 * process.c (Fnetwork_interface_info): Declare local only if needed.
10298
10299 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10300
10301 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10302 (Fnetwork_interface_list): Allocate in increments of bytes instead
10303 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10304 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10305 sockaddr.
10306 (struct ifflag_def): notrailers is smart on OSX.
10307 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10308 Get hardware address with getifaddrs if available.
10309
10310 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10311
10312 * xdisp.c (iterate_out_of_display_property): xassert that
10313 IT->position is set to within IT->object's boundaries. Break from
10314 the loop as soon as EOB is reached; avoids infloops in redisplay
10315 when IT->position is set up wrongly due to some bug.
10316 Set IT->current to match the bidi iterator unconditionally.
10317 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10318 entry. Force push_it to save on the stack the current
10319 buffer/string position, to be restored by pop_it. Fix flags in
10320 the iterator structure wrt the object coming from a display
10321 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10322 properties. (Bug#9284)
10323
10324 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10325
10326 * fontset.c (fontset_get_font_group): Add proper type checks.
10327 (Bug#9172)
10328
10329 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10330
10331 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10332 and LC_VERSION_MIN_MACOSX.
10333 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10334 (dump_it) [LC_FUNCTION_STARTS]: Use it.
10335
10336 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10337
10338 * xdisp.c (forward_to_next_line_start): Allow to use the
10339 no-display-properties-and-no-overlays under bidi display.
10340 Set disp_pos in the bidi iterator to avoid searches for display
10341 properties and overlays.
10342
10343 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10344
10345 * editfns.c (Fset_time_zone_rule): Document relationship with the
10346 setenv function.
10347
10348 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10349 the font entity extracted from the cache (Bug#8109).
10350
10351 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10352
10353 * composite.c (autocmp_chars): Don't reset point. That is done by
10354 restore_point_unwind (Bug#5984).
10355
10356 2011-08-07 Juri Linkov <juri@jurta.org>
10357
10358 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10359 to show the arg `TIME' instead of `TIMEVAL'.
10360
10361 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10362
10363 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10364 display property strides EOL and includes a newline, as in
10365 longlines-mode. (Bug#9254)
10366 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10367 word-wrap under bidirectional display. (Bug#9224)
10368
10369 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10370 is non-zero, even if the data buffer is NULL. Fixes a crash in
10371 vertical-motion with longlines-mode. (Bug#9254)
10372
10373 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10374
10375 * bidi.c <bidi_cache_total_alloc>: Now static.
10376 (bidi_initialize): Initialize bidi_cache_total_alloc.
10377
10378 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10379 cache. (Bug#9221)
10380
10381 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10382 amount allocated this far in `bidi_cache_total_alloc'.
10383 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10384 non-zero, only free the data buffer without restoring the cache
10385 contents. All callers changed.
10386
10387 * dispextern.h (bidi_unshelve_cache): Update prototype.
10388
10389 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10390 (move_it_in_display_line, move_it_to)
10391 (move_it_vertically_backward, move_it_by_lines): Replace the call
10392 to xfree to an equivalent call to bidi_unshelve_cache.
10393 (move_it_in_display_line_to): Fix logic of returning
10394 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
10395
10396 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10397
10398 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10399 came from a string character with a `cursor' property. (Bug#9229)
10400
10401 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10402
10403 * Makefile.in (LIB_PTHREAD): New variable.
10404 (LIBES): Add LIB_PTHREAD (Bug#9216).
10405
10406 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10407 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10408
10409 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10410
10411 * regex.c (re_iswctype): Remove some redundant boolean conversions.
10412
10413 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10414
10415 * xterm.c (x_find_topmost_parent): New function.
10416 (x_set_frame_alpha): Find topmost parent window with
10417 x_find_topmost_parent and set the property there also (bug#9181).
10418 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10419
10420 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10421
10422 * callproc.c (Fcall_process): Avoid vfork clobbering
10423 the local vars buffer, coding_systems, current_dir.
10424
10425 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10426
10427 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10428
10429 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10430
10431 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10432 so that it is not optimized away.
10433
10434 * xdisp.c (compute_display_string_pos): Remove unused local.
10435
10436 2011-08-02 Eli Zaretskii <eliz@gnu.org>
10437
10438 Fix slow cursor motion and scrolling in large buffers with
10439 selective display, like Org Mode buffers. (Bug#9218)
10440
10441 * dispextern.h (struct bidi_it): New member disp_prop_p.
10442
10443 * xdisp.c: Remove one-slot cache of display string positions.
10444 (compute_display_string_pos): Accept an additional argument
10445 DISP_PROP_P; callers changed. Scan at most 5K characters forward
10446 for a display string or property. If found, set DISP_PROP_P
10447 non-zero.
10448
10449 * bidi.c (bidi_fetch_char): Accept an additional argument
10450 DISP_PROP_P, and pass it to compute_display_string_pos.
10451 Only handle text covered by a display string if DISP_PROP_P is returned
10452 non-zero. All callers of bidi_fetch_char changed.
10453
10454 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10455
10456 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10457
10458 2010-12-03 Don March <don@ohspite.net>
10459
10460 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10461 last character M-[char] is translated to ESC [char] (bug#7541).
10462
10463 2011-08-02 Kenichi Handa <handa@m17n.org>
10464
10465 * lisp.h (uniprop_table): Extern it.
10466
10467 * chartab.c (uniprop_table): Make it non-static.
10468
10469 2011-08-01 Eli Zaretskii <eliz@gnu.org>
10470
10471 * xdisp.c (forward_to_next_line_start): Accept additional argument
10472 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10473 on the newline.
10474 (reseat_at_next_visible_line_start): Use the bidi iterator state
10475 returned by forward_to_next_line_start to restore the state of
10476 it->bidi_it after backing up to previous newline. (Bug#9212)
10477
10478 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10479
10480 * regex.c (re_comp): Protoize.
10481 (re_exec): Fix return type.
10482 (regexec): Fix type of `ret'. (Bug#9203)
10483
10484 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10485
10486 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10487 This is needed if max-image-size is a floating-point number.
10488
10489 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10490
10491 * print.c (print_object): Print empty symbol as ##.
10492
10493 * lread.c (read1): Read ## as empty symbol.
10494
10495 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10496
10497 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10498 setting frame foreground color (Bug#9175).
10499 (x_set_background_color): Likewise.
10500
10501 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10502 contents (Bug#9176).
10503 (EmacsTooltip -init): Remove bezels and add shadows to
10504 tooltip windows.
10505
10506 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10507 or scroll bar (Bug#8470).
10508
10509 * nsfont.m (nsfont_open): Remove assignment to voffset and
10510 unnecessary vars hshink, expand, hd, full_height, min_height.
10511 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10512
10513 * nsterm.h (nsfont_info): Remove voffset field.
10514
10515 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10516
10517 Implement strike-through and overline on NextStep (Bug#8863).
10518
10519 * nsfont.m (nsfont_open): Use underline position provided by font,
10520 instead of hard-coded value of 2.
10521 (nsfont_draw): Call ns_draw_text_decoration instead.
10522
10523 * nsterm.h: Add declaration for ns_draw_text_decoration.
10524
10525 * nsterm.m (ns_draw_text_decoration): New function for drawing
10526 underline, overline, and strike-through.
10527 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10528 ns_draw_text_decoration. Change treatment of cursor drawing to
10529 accommodate underlining, etc.
10530
10531 2011-07-28 Eli Zaretskii <eliz@gnu.org>
10532
10533 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10534 default.
10535
10536 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10537
10538 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10539 Without this fix, if a signal arrives just after memory fills up,
10540 'malloc' might be invoked reentrantly.
10541
10542 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10543 In other words, assume that every image size is allowed, on non-X
10544 hosts. This assumption is probably wrong, but it lets Emacs compile.
10545
10546 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10547
10548 * regex.c (re_iswctype): Convert return values to boolean.
10549
10550 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10551
10552 * xdisp.c (compute_display_string_pos): Don't use cached display
10553 string position if the buffer had its restriction changed.
10554 (Bug#9184)
10555
10556 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10557
10558 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10559
10560 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10561
10562 Integer signedness and overflow and related fixes. (Bug#9079)
10563
10564 * bidi.c: Integer size and overflow fixes.
10565 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10566 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10567 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10568 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10569 (bidi_find_other_level_edge):
10570 Use ptrdiff_t instead of EMACS_INT where either will do.
10571 This works better on 32-bit hosts configured --with-wide-int.
10572 (bidi_cache_ensure_space): Check for size-calculation overflow.
10573 Use % rather than repeated addition, for better worst-case speed.
10574 Don't set bidi_cache_size until after xrealloc returns, because it
10575 might not return.
10576 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
10577 (bidi_cache_ensure_space): Also check that the bidi cache size
10578 does not exceed that of the largest Lisp string or buffer. See Eli
10579 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
10580
10581 * alloc.c (__malloc_size_t): Remove.
10582 All uses replaced by size_t. See Andreas Schwab's note
10583 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10584
10585 * image.c: Improve checking for integer overflow.
10586 (check_image_size): Assume that f is nonnull, since
10587 it is always nonnull in practice. This is one less thing to
10588 worry about when checking for integer overflow later.
10589 (x_check_image_size): New function, which checks for integer
10590 overflow issues inside X.
10591 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10592 This removes the need for a memory_full check.
10593 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10594 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10595 (xbm_read_bitmap_data): Change locals back to 'int', since
10596 their values must fit in 'int'.
10597 (xpm_load_image, png_load, tiff_load):
10598 Invoke x_create_x_image_and_pixmap earlier,
10599 to avoid much needless work if the image is too large.
10600 (tiff_load): Treat overly large images as if
10601 x_create_x_image_and_pixmap failed, not as malloc failures.
10602 (gs_load): Use x_check_image_size.
10603
10604 * gtkutil.c: Omit integer casts.
10605 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10606 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10607
10608 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10609
10610 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10611 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10612 would wrongly return t on a 64-bit host.
10613
10614 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10615 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10616 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10617 and therefore cause GCC to emit a bogus diagnostic in some cases.
10618
10619 * image.c: Integer signedness and overflow and related fixes.
10620 This is not an exhaustive set of fixes, but it's time to
10621 record what I've got.
10622 (lookup_pixel_color, check_image_size): Remove redundant decls.
10623 (check_image_size): Don't assume that arbitrary EMACS_INT values
10624 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10625 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10626 (tiff_load, imagemagick_load_image):
10627 Check for overflow in size calculations.
10628 (x_create_x_image_and_pixmap): Remove unnecessary test for
10629 xmalloc returning NULL; that can't happen.
10630 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10631 (xpm_color_bucket): Use better integer hashing function.
10632 (xpm_cache_color): Don't possibly over-allocate memory.
10633 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10634 (gif_memory_source):
10635 Use ptrdiff_t, not int or size_t, to record sizes.
10636 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10637 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10638 either works, as we prefer signed integers.
10639 (tiff_read_from_memory, tiff_write_from_memory):
10640 Return tsize_t, not size_t, since that's what the TIFF API wants.
10641 (tiff_read_from_memory): Don't fail simply because the read would
10642 go past EOF; instead, return a short read.
10643 (tiff_load): Omit no-longer-needed casts.
10644 (Fimagemagick_types): Don't assume size fits into 'int'.
10645
10646 Improve hashing quality when configured --with-wide-int.
10647 * fns.c (hash_string): New function, taken from sxhash_string.
10648 Do not discard information about ASCII character case; this
10649 discarding is no longer needed.
10650 (sxhash-string): Use it. Change sig to match it. Caller changed.
10651 * lisp.h: Declare it.
10652 * lread.c (hash_string): Remove, since we now use fns.c's version.
10653 The fns.c version returns a wider integer if --with-wide-int is
10654 specified, so this should help the quality of the hashing a bit.
10655
10656 * emacs.c: Integer overflow minor fix.
10657 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10658 Define only if GNU_LINUX.
10659 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10660
10661 * dispnew.c: Integer signedness and overflow fixes.
10662 Remove unnecessary forward decls, that were a maintenance hassle.
10663 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10664 All uses changed.
10665 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10666 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10667 (prepare_desired_row, line_draw_cost):
10668 Use int, not unsigned, where either works.
10669 (save_current_matrix, restore_current_matrix):
10670 Use ptrdiff_t, not size_t, where either works.
10671 (init_display): Check for overflow more accurately, and without
10672 relying on undefined behavior.
10673
10674 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10675 Remove, replacing with the new symbols in lisp.h. All uses changed.
10676 * fileio.c (make_temp_name):
10677 * filelock.c (lock_file_1, lock_file):
10678 * xdisp.c (message_dolog):
10679 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10680 Use pMd etc. instead.
10681 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10682 replacing the pWIDE etc. symbols removed from editfns.c.
10683
10684 * keyboard.h (num_input_events): Now uintmax_t.
10685 This is (very slightly) less likely to mess up due to wraparound.
10686 All uses changed.
10687
10688 * buffer.c: Integer signedness fixes.
10689 (alloc_buffer_text, enlarge_buffer_text):
10690 Use ptrdiff_t rather than size_t when either will do, as we prefer
10691 signed integers.
10692
10693 * alloc.c: Integer signedness and overflow fixes.
10694 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10695 (__malloc_size_t): Default to size_t, not to int.
10696 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10697 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10698 Prefer ptrdiff_t to size_t when either would do, as we prefer
10699 signed integers.
10700 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10701 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10702 Now const. Initialize with values that are in range even if char
10703 is signed.
10704 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10705 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10706 These functions do the right thing with sizes > 2**32.
10707 (check_depth): Now ptrdiff_t, not int.
10708 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10709 Adjust to new way of storing sizes. Check for size overflow bugs
10710 in rest of code.
10711 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10712 slightly wrong anyway, as it missed one instance of
10713 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10714 (refill_memory_reserve): Omit needless cast to size_t.
10715 (mark_object_loop_halt): Mark as externally visible.
10716
10717 * xselect.c: Integer signedness and overflow fixes.
10718 (Fx_register_dnd_atom, x_handle_dnd_message):
10719 Use ptrdiff_t, not size_t, since we prefer signed.
10720 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10721 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10722 x_dnd_atoms_size and x_dnd_atoms_length.
10723
10724 * doprnt.c: Prefer signed to unsigned when either works.
10725 * eval.c (verror):
10726 * doprnt.c (doprnt):
10727 * lisp.h (doprnt):
10728 * xdisp.c (vmessage):
10729 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10730 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10731 prefer signed arithmetic to avoid comparison confusion.
10732 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10733 but is a bit tricky.
10734
10735 Assume freestanding C89 headers, string.h, stdlib.h.
10736 * data.c, doprnt.c, floatfns.c, print.c:
10737 Include float.h unconditionally.
10738 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10739 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10740 * regex.c: Likewise for stddef.h, string.h.
10741 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10742 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10743 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10744 (STDC_HEADERS): Remove obsolete defines.
10745 * sysdep.c: Include limits.h unconditionally.
10746
10747 Assume support for memcmp, memcpy, memmove, memset.
10748 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10749 * regex.c (memcmp, memcpy):
10750 Remove; we assume C89 now.
10751
10752 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10753 (__malloc_safe_bcopy): Remove; no longer needed.
10754
10755 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
10756 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10757 well either way, and we prefer signed to unsigned.
10758
10759 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10760
10761 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10762 closes the connection while we're reading (bug#9182).
10763
10764 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
10765
10766 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10767 are specified (Bug#9168).
10768
10769 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10770
10771 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10772 Found by GCC static checking and --with-wide-int on a 32-bit host.
10773
10774 2011-07-25 Eli Zaretskii <eliz@gnu.org>
10775
10776 * xdisp.c (compute_display_string_pos): Fix logic of caching
10777 previous display string position. Initialize cached_prev_pos to
10778 -1. Fixes slow-down at the beginning of a buffer.
10779
10780 2011-07-24 Eli Zaretskii <eliz@gnu.org>
10781
10782 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10783 for attrs[LFACE_FONTSET_INDEX].
10784
10785 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10786
10787 * xml.c (parse_region): Remove unused local
10788 that was recently introduced.
10789
10790 2011-07-23 Eli Zaretskii <eliz@gnu.org>
10791
10792 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10793 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10794
10795 * xdisp.c (move_it_in_display_line_to): Record the best matching
10796 position for TO_CHARPOS while scanning the line, and restore it on
10797 exit if none of the characters scanned was an exact match.
10798 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
10799 when exact match is impossible due to invisible text, and the
10800 lines are truncated.
10801
10802 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10803
10804 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10805 for OSX >= 10.7.
10806
10807 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10808
10809 Fix a significant slow-down of cursor motion with C-n, C-p,
10810 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10811 auto-repeat under bidi redisplay in fontified buffers.
10812 * xdisp.c (compute_stop_pos_backwards): New function.
10813 (next_element_from_buffer): Call compute_stop_pos_backwards to
10814 find a suitable prev_stop when we find ourselves before
10815 base_level_stop.
10816 (reseat): Don't look for prev_stop, as that could mean a very long
10817 run.
10818 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10819 <cached_disp_overlay_modiff>: Cache for last found display string
10820 position.
10821 (compute_display_string_pos): Return the cached position if asked
10822 about the same buffer in the same area of character positions, and
10823 the buffer wasn't changed since the time the display string
10824 position was cached.
10825
10826 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10827
10828 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10829 is an integer, which is important for empty lines. (Bug#9149)
10830
10831 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
10832
10833 * frame.c (Fmodify_frame_parameters): In tty case, update the
10834 default face if necessary (Bug#4238).
10835
10836 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
10837
10838 * editfns.c (Fstring_to_char): No need to explain what a character
10839 is in the docstring (Bug#6576).
10840
10841 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10842
10843 * xml.c (parse_region): Make sure we always return a tree.
10844
10845 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10846
10847 * xml.c (parse_region): If a document contains only comments,
10848 return that, too.
10849
10850 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10851
10852 * xml.c (make_dom): Return comments, too.
10853
10854 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10855
10856 Port to OpenBSD.
10857 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10858 and the surrounding thread.
10859 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10860 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10861 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10862 timer goes off.
10863 * s/openbsd.h (BROKEN_SIGIO): Define.
10864 * unexelf.c (unexec) [__OpenBSD__]:
10865 Don't update the .mdebug section of the Alpha COFF symbol table.
10866
10867 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10868
10869 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10870 (bug#8460).
10871
10872 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10873
10874 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10875 This fixes some race conditions on the permissions of any newly
10876 created file.
10877
10878 * alloc.c (valid_pointer_p): Use pipe, not open.
10879 This fixes some permissions issues when debugging.
10880
10881 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10882 If fchown fails to set both uid and gid, try to set just gid,
10883 as that is sometimes allowed. Adjust the file's mode to eliminate
10884 setuid or setgid bits that are inappropriate if fchown fails.
10885
10886 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10887
10888 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10889 to compare Lisp_Objects.
10890 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10891 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10892 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10893
10894 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10895
10896 * lread.c (read_integer): Unread even EOF character.
10897 (read1): Likewise. Properly record start position of symbol.
10898
10899 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10900 symbol character follows.
10901
10902 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10903
10904 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10905 This works around a problem with the previous change to Fcopy_file.
10906 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10907 and without this change, GCC might complain about discarding
10908 fchown's return value.
10909
10910 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
10911
10912 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10913
10914 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10915
10916 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10917
10918 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10919
10920 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10921 it's used from the C level.
10922
10923 * process.c: Use the same condition for POLL_FOR_INPUT in both
10924 keyboard.c and process.c (bug#1858).
10925
10926 2011-07-09 Lawrence Mitchell <wence@gmx.li>
10927
10928 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10929 (Fgnutls_boot): Use it.
10930
10931 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10932
10933 * doc.c (Fsubstitute_command_keys): Revert last change.
10934
10935 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10936
10937 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10938 quotes the next character, and doesn't affect other longer
10939 sequences (bug#8935).
10940
10941 * lread.c (syms_of_lread): Clarify that is isn't only
10942 `eval-buffer' and `eval-defun' that's affected by
10943 `lexical-binding' (bug#8460).
10944
10945 2011-07-15 Eli Zaretskii <eliz@gnu.org>
10946
10947 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
10948 bidi redisplay when a line includes both an image and is truncated.
10949
10950 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10951
10952 Fix minor problems found by static checking.
10953 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10954 (elsz): Now a signed constant, not a size_t var. We prefer signed
10955 types to unsigned, to avoid integer comparison confusion. Without
10956 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10957 "cannot optimize loop, the loop counter may overflow", a symptom
10958 of the confusion.
10959 * indent.c (Fvertical_motion): Mark locals as initialized.
10960 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10961
10962 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10963
10964 * search.c (Fre_search_backward): Mention `case-fold-search' in
10965 all the re_search_* functions (bug#8138).
10966
10967 * keyboard.c (Fopen_dribble_file): Document when the file is
10968 closed (bug#8056).
10969
10970 2011-07-14 Eli Zaretskii <eliz@gnu.org>
10971
10972 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10973 bidi_cache_idx.
10974
10975 Support bidi reordering of display and overlay strings.
10976 * xdisp.c (compute_display_string_pos)
10977 (compute_display_string_end): Accept additional argument STRING.
10978 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10979 (reseat_to_string): Initialize bidi_it->string.s and
10980 bidi_it->string.schars.
10981 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
10982 NULL (avoids a crash in bidi_paragraph_init).
10983 Initialize itb.string.lstring.
10984 (init_iterator): Call bidi_init_it only of a valid
10985 buffer position was specified. Initialize paragraph_embedding to
10986 L2R.
10987 (reseat_to_string): Initialize the bidi iterator.
10988 (display_string): If we need to ignore text properties of
10989 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10990 original value of -1 will not work with bidi.)
10991 (compute_display_string_pos): First arg is now struct
10992 `text_pos *'; all callers changed. Support display properties on
10993 Lisp strings.
10994 (compute_display_string_end): Support display properties on Lisp
10995 strings.
10996 (init_iterator, reseat_1, reseat_to_string): Initialize the
10997 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10998 when iterating on a string not from display properties).
10999 (compute_display_string_pos, compute_display_string_end):
11000 Fix calculation of the object to scan. Fixes an error when using
11001 arrow keys.
11002 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11003 base_level_stop; instead, set base_level_stop to BEGV.
11004 Fixes crashes in vertical-motion.
11005 (next_element_from_buffer): Improve commentary for when
11006 the iterator is before prev_stop.
11007 (init_iterator): Initialize bidi_p from the default value of
11008 bidi-display-reordering, not from buffer-local value. Use the
11009 buffer-local value only if initializing for buffer iteration.
11010 (handle_invisible_prop): Support invisible properties on strings
11011 that are being bidi-reordered.
11012 (set_iterator_to_next): Support bidi reordering of C strings and
11013 Lisp strings.
11014 (next_element_from_string): Support bidi reordering of Lisp
11015 strings.
11016 (handle_stop_backwards): Support Lisp strings as well.
11017 (display_string): Support display of R2L glyph rows.
11018 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11019 (init_iterator): Don't initialize it->bidi_p for strings
11020 here.
11021 (reseat_to_string): Initialize it->bidi_p for strings here.
11022 (next_element_from_string, next_element_from_c_string)
11023 (next_element_from_buffer): Add xassert's for correspondence
11024 between IT's object being iterated and it->bidi_it.string
11025 structure.
11026 (face_before_or_after_it_pos): Support bidi iteration.
11027 (next_element_from_c_string): Handle the case of the first string
11028 character that is not the first one in the visual order.
11029 (get_visually_first_element): New function, refactored from common
11030 parts of next_element_from_buffer, next_element_from_string, and
11031 next_element_from_c_string.
11032 (tool_bar_lines_needed, redisplay_tool_bar)
11033 (display_menu_bar): Force left-to-right direction. Add a FIXME
11034 comment for making that be controlled by a user option.
11035 (push_it, pop_it): Save and restore the state of the
11036 bidi iterator. Save and restore the bidi_p flag.
11037 (pop_it): Iterate out of display property for string iteration as
11038 well.
11039 (iterate_out_of_display_property): Support iteration over strings.
11040 (handle_single_display_spec): Set up it->bidi_it for iteration
11041 over a display string, and call bidi_init_it.
11042 (handle_single_display_spec, next_overlay_string)
11043 (get_overlay_strings_1, push_display_prop): Set up the bidi
11044 iterator for displaying display or overlay strings.
11045 (forward_to_next_line_start): Don't use the shortcut if
11046 bidi-iterating.
11047 (back_to_previous_visible_line_start): If handle_display_prop
11048 pushed the iterator stack, restore the internal state of the bidi
11049 iterator by calling bidi_pop_it same number of times.
11050 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11051 and we are bidi-iterating, don't decrement the iterator position;
11052 instead, set the first_elt flag in the bidi iterator, to produce
11053 the same effect.
11054 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11055 (push_display_prop): xassert that we are iterating a buffer.
11056 (push_it, pop_it): Save and restore paragraph_embedding member.
11057 (handle_single_display_spec, next_overlay_string)
11058 (get_overlay_strings_1, reseat_1, reseat_to_string)
11059 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11060 correctly. Don't assume unibyte strings are not bidi-reordered.
11061 (compute_display_string_pos)
11062 (compute_display_string_end): Fix handling the case of C string.
11063 (push_it, pop_it): Save and restore from_disp_prop_p.
11064 (handle_single_display_spec, push_display_prop): Set the
11065 from_disp_prop_p flag.
11066 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11067 (pop_it): Call iterate_out_of_display_property only if we are
11068 popping after iteration over a string that came from a display
11069 property. Fix a typo in popping stretch info. Add an assertion
11070 for verifying that the iterator position is in sync with the bidi
11071 iterator.
11072 (handle_single_display_spec, get_overlay_strings_1)
11073 (push_display_prop): Fix initialization of paragraph direction for
11074 string when that of the parent object is not yet determined.
11075 (reseat_1): Call bidi_init_it to resync the bidi
11076 iterator with IT's position. (Bug#7616)
11077 (find_row_edges): If ROW->start.pos gives position
11078 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11079 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11080 Reset the from_disp_prop_p flag.
11081 (SAVE_IT, RESTORE_IT): New macros.
11082 (pos_visible_p, face_before_or_after_it_pos)
11083 (back_to_previous_visible_line_start)
11084 (move_it_in_display_line_to, move_it_in_display_line)
11085 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11086 (try_scrolling, redisplay_window, display_line): Use them when
11087 saving a temporary copy of the iterator and restoring it back.
11088 (back_to_previous_visible_line_start, reseat_1)
11089 (init_iterator): Empty the bidi cache "stack".
11090 (move_it_in_display_line_to): If iterator ended up at
11091 EOL, but we never saw any buffer positions smaller than
11092 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11093 motion in bidi-reordered lines.
11094 (move_it_in_display_line_to): Record prev_method and prev_pos
11095 immediately before the call to set_iterator_to_next. Fixes cursor
11096 motion in bidi-reordered lines with stretch glyphs and strings
11097 displayed in margins. (Bug#8133) (Bug#8867)
11098 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11099 TO_CHARPOS.
11100 (pos_visible_p): Support positions in bidi-reordered lines.
11101 Save and restore bidi cache.
11102
11103 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11104 (bidi_paragraph_info): Delete unused struct.
11105 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11106 (bidi_cache_start): New variable.
11107 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11108 to zero.
11109 (bidi_cache_fetch_state, bidi_cache_search)
11110 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11111 (bidi_cache_find, bidi_peek_at_next_level)
11112 (bidi_level_of_next_char, bidi_find_other_level_edge)
11113 (bidi_move_to_visually_next): Compare cache index with
11114 bidi_cache_start rather than with zero.
11115 (bidi_fetch_char): Accept new argument STRING; all callers
11116 changed. Support iteration over a string. Support strings with
11117 display properties. Support unibyte strings. Fix the type of
11118 `len' according to what STRING_CHAR_AND_LENGTH expects.
11119 (bidi_paragraph_init, bidi_resolve_explicit_1)
11120 (bidi_resolve_explicit, bidi_resolve_weak)
11121 (bidi_level_of_next_char, bidi_move_to_visually_next):
11122 Support iteration over a string.
11123 (bidi_set_sor_type, bidi_resolve_explicit_1)
11124 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11125 can now be zero (for strings); special values 0 and -1 were
11126 changed to -1 and -2, respectively.
11127 (bidi_char_at_pos): New function.
11128 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11129 Call it instead of FETCH_MULTIBYTE_CHAR.
11130 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11131 initialized to valid values.
11132 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11133 values.
11134 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11135 the test for valid cached positions. Fix the logic for looking up
11136 the sentinel state in the cache. GCPRO the Lisp string we are
11137 iterating.
11138 (bidi_push_it, bidi_pop_it): New functions.
11139 (bidi_initialize): Initialize the bidi cache start stack pointer.
11140 (bidi_cache_ensure_space): New function, refactored from part of
11141 bidi_cache_iterator_state. Don't assume the required size is just
11142 one BIDI_CACHE_CHUNK away.
11143 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11144 (bidi_count_bytes, bidi_char_at_pos): New functions.
11145 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11146 always valid if bidi_cache_idx is valid.
11147 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11148 is valid if it's going to be used.
11149 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11150 (bidi_cache_fetch_state, bidi_cache_search)
11151 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11152 (bidi_cache_iterator_state, bidi_cache_find)
11153 (bidi_find_other_level_edge, bidi_cache_start_stack):
11154 All variables related to cache indices are now EMACS_INT.
11155
11156 * dispextern.h (struct bidi_string_data): New structure.
11157 (struct bidi_it): New member `string'. Make flag members be 1-bit
11158 fields, and put them last in the struct.
11159 (compute_display_string_pos, compute_display_string_end):
11160 Update prototypes.
11161 (bidi_push_it, bidi_pop_it): Add prototypes.
11162 (struct iterator_stack_entry): New members bidi_p,
11163 paragraph_embedding, and from_disp_prop_p.
11164 (struct it): Member bidi_p is now a bit field 1 bit wide.
11165 (bidi_shelve_cache, bidi_unshelve_cache):
11166 Declare prototypes.
11167
11168 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11169 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11170 and vector-like objects.
11171
11172 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11173 cache around display iteration.
11174
11175 * window.c (Fwindow_end, window_scroll_pixel_based)
11176 (displayed_window_lines, Frecenter): Save and restore the bidi
11177 cache around display iteration.
11178
11179 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11180
11181 * editfns.c (Fdelete_region): Clarify the use of the named
11182 parameters (bug#6788).
11183
11184 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11185
11186 * indent.c (Fvertical_motion): Set and restore w->pointm when
11187 saving and restoring the window's buffer (Bug#9006).
11188
11189 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11190
11191 * editfns.c (Fstring_to_char): Clarify just what is returned
11192 (bug#6576). Text by Eli Zaretskii.
11193
11194 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11195
11196 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11197
11198 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11199
11200 * buffer.c (mmap_find): Fix a typo.
11201
11202 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11203
11204 Fix execution of x selection hooks.
11205 * xselect.c (Qx_lost_selection_functions)
11206 (Qx_sent_selection_functions): New vars.
11207 (syms_of_xselect): DEFSYM them.
11208 (x_handle_selection_request): Pass Qx_sent_selection_functions
11209 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11210 (x_handle_selection_clear,x_clear_frame_selections):
11211 Pass Qx_lost_selection_functions rather than
11212 Vx_lost_selection_functions to Frun_hook_with_args.
11213
11214 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11215
11216 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11217 The old code sometimes used this field without initializing it.
11218
11219 * alloc.c (gc_sweep): Don't read past end of array.
11220 In theory, the old code could also have corrupted Emacs internals,
11221 though it'd be very unlikely.
11222
11223 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11224
11225 * character.c (Fcharacterp): Don't advertise optional ignored
11226 argument. (Bug#4026)
11227
11228 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11229
11230 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11231 key" (bug#4257).
11232
11233 * window.c (Fset_window_start): Doc fix (bug#4199).
11234 (Fset_window_hscroll): Ditto.
11235
11236 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11237
11238 Fix minor new problems caught by GCC 4.6.1.
11239 * term.c (init_tty): Remove unused local.
11240 * xsettings.c (store_monospaced_changed): Define this function only
11241 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11242 not used otherwise.
11243
11244 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11245
11246 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11247
11248 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11249
11250 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11251 are the mini-buffer and the echo area (bug#3320).
11252
11253 * term.c (init_tty): Remove support for supdup, c10 and perq
11254 terminals, which are no longer supported (bug#1482).
11255
11256 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11257
11258 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11259
11260 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11261
11262 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11263 for non-popups (Bug#3642).
11264
11265 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11266
11267 * alloc.c (reset_malloc_hooks): Protoize.
11268 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11269 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11270 * cm.c (losecursor): Likewise.
11271 * data.c (fmod): Likewise.
11272 * dispnew.c (swap_glyphs_in_rows): Likewise.
11273 * emacs.c (memory_warning_signal): Likewise.
11274 * floatfns.c (float_error): Likewise.
11275 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11276 (otf_open, font_otf_capability, generate_otf_features)
11277 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11278 Likewise.
11279 * image.c (pbm_read_file): Likewise.
11280 * indent.c (string_display_width): Likewise.
11281 * intervals.c (check_for_interval, search_for_interval)
11282 (inc_interval_count, count_intervals, root_interval)
11283 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11284 * lread.c (defalias): Likewise.
11285 * ralloc.c (r_alloc_check): Likewise.
11286 * regex.c (set_image_of_range_1, set_image_of_range)
11287 (regex_grow_registers): Likewise.
11288 * sysdep.c (strerror): Likewise.
11289 * termcap.c (valid_filename_p, tprint, main): Likewise.
11290 * tparam.c (main): Likewise.
11291 * unexhp9k800.c (run_time_remap, save_data_space)
11292 (update_file_ptrs, read_header, write_header, calculate_checksum)
11293 (copy_file, copy_rest, display_header): Likewise.
11294 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11295 Likewise.
11296 * xdisp.c (check_it): Likewise.
11297 * xfaces.c (register_color, unregister_color, unregister_colors):
11298 Likewise.
11299 * xfns.c (print_fontset_result): Likewise.
11300 * xrdb.c (member, fatal, main): Likewise.
11301
11302 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11303
11304 Fix minor problems found by static checking (Bug#9031).
11305 * chartab.c (char_table_set_range, map_sub_char_table):
11306 Remove unused locals.
11307 (uniprop_table): Now static.
11308 * composite.c (_work_char): Remove unused static var.
11309
11310 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11311
11312 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11313
11314 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11315
11316 * gtkutil.c (qttip_cb): Remove code without function.
11317
11318 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11319
11320 * w32.c (pthread_sigmask): New stub.
11321
11322 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11323
11324 Use pthread_sigmask, not sigprocmask (Bug#9010).
11325 sigprocmask is portable only for single-threaded applications, and
11326 Emacs can be multi-threaded when it uses GTK.
11327 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11328 (LIBES): Use it.
11329 * callproc.c (Fcall_process):
11330 * process.c (create_process):
11331 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11332 Use pthread_sigmask, not sigprocmask.
11333
11334 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11335
11336 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11337 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11338 wrong (Bug#8591).
11339
11340 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11341
11342 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11343 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11344 (xg_hide_tooltip): Fix comment.
11345
11346 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11347 in registerServicesMenuSendTypes.
11348 (validRequestorForSendType): Don't check ns_return_types.
11349
11350 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11351 ns_return_type.
11352
11353 2011-07-08 Jason Rumney <jasonr@gnu.org>
11354
11355 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11356 SH_SHOW for hidden windows (Bug#5482).
11357
11358 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11359 frame struct members of non-existent frames (Bug#6284).
11360
11361 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11362
11363 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11364 variable firstTime not needed on OSX >= 10.6.
11365 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11366 >= 10.5. Use setKnobProportion, setDoubleValue.
11367
11368 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11369 (MAC_OS_X_VERSION_10_5): Define if not defined.
11370 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11371 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11372 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11373
11374 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11375 cString and lossyCString on OSX >= 10.4.
11376
11377 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11378 sizeToFit on OSX >= 10.2.
11379
11380 * nsimage.m (allocInitFromFile): Don't use deprecated method
11381 bestRepresentationForDevice on OSX >= 10.6.
11382
11383 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11384 to avoid warning.
11385
11386 * emacs.c: Declare unexec_init_emacs_zone.
11387
11388 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11389
11390 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11391
11392 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11393 on svcsMenu (Bug#8842).
11394
11395 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11396 ns_return_types.
11397 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11398
11399 * nsterm.m (QUTF8_STRING): Declare.
11400 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11401 (validRequestorForSendType): Return type is (id).
11402 Change indexOfObjectIdenticalTo to indexOfObject.
11403 Check if we have local selection before returning self (Bug#8842).
11404 (writeSelectionToPasteboard): Put local selection into paste board
11405 if we have a local selection (Bug#8842).
11406 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11407
11408 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11409 (ns_get_local_selection): Declare.
11410
11411 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11412
11413 * keymap.c (describe_map_tree): Don't insert a double newline at
11414 the end of the buffer (bug#1169) and return whether we inserted
11415 something.
11416
11417 * callint.c (Fcall_interactively): Change "reading args" to
11418 "providing args" to try to clarify what it does (bug#1010).
11419
11420 2011-07-07 Kenichi Handa <handa@m17n.org>
11421
11422 * composite.c (composition_compute_stop_pos): Ignore a static
11423 composition starting before CHARPOS (Bug#8915).
11424
11425 * xdisp.c (handle_composition_prop): Likewise.
11426
11427 2011-07-07 Eli Zaretskii <eliz@gnu.org>
11428
11429 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11430 (Bug#9015)
11431
11432 2011-07-07 Kenichi Handa <handa@m17n.org>
11433
11434 * character.h (unicode_category_t): New enum type.
11435
11436 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11437 (Qchar_code_property_table): New variable.
11438 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11439 (UNIPROP_COMPRESSED_FORM_P): New macros.
11440 (char_table_ascii): Uncompress the compressed values.
11441 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11442 Uncompress the compressed values.
11443 (sub_char_table_ref_and_range): Likewise.
11444 (char_table_ref_and_range): Uncompress the compressed values.
11445 (sub_char_table_set): New arg is_uniprop. Callers changed.
11446 Uncompress the compressed values.
11447 (sub_char_table_set_range): Args changed. Callers changed.
11448 (char_table_set_range): Adjuted for the above change.
11449 (map_sub_char_table): Delete args default_val and parent. Add arg
11450 top. Give decoded values to a Lisp function.
11451 (map_char_table): Adjust for the above change. Give decoded
11452 values to a Lisp function. Gcpro more variables.
11453 (uniprop_table_uncompress)
11454 (uniprop_decode_value_run_length): New functions.
11455 (uniprop_decoder, uniprop_decoder_count): New variables.
11456 (uniprop_get_decoder, uniprop_encode_value_character)
11457 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11458 New functions.
11459 (uniprop_encoder, uniprop_encoder_count): New variables.
11460 (uniprop_get_encoder, uniprop_table)
11461 (Funicode_property_table_internal, Fget_unicode_property_internal)
11462 (Fput_unicode_property_internal): New functions.
11463 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11464 Sunicode_property_table_internal, Sget_unicode_property_internal,
11465 and Sput_unicode_property_internal. Defvar_lisp
11466 char-code-property-alist.
11467
11468 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11469 Vunicode_category_table.
11470
11471 * font.c (font_range): Adjust for the change of
11472 Vunicode_category_table.
11473
11474 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11475
11476 * m/iris4d.h: Remove file, move contents ...
11477 * s/irix6-5.h: ... here.
11478
11479 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11480
11481 Remove unportable assumption about struct layout (Bug#8884).
11482 * alloc.c (mark_buffer):
11483 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11484 (clone_per_buffer_values): Don't assume that
11485 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11486 This isn't true in general, and it's particularly not true
11487 if Emacs is configured with --with-wide-int.
11488 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11489 New macros, used in the buffer.c change.
11490
11491 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11492
11493 * xsettings.c: Use both GConf and GSettings if both are available.
11494 (store_config_changed_event): Add comment.
11495 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11496 (store_tool_bar_style_changed): New functions.
11497 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
11498 (struct xsettings): Move font inside HAVE_XFT.
11499 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
11500 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
11501 Move inside HAVE_XFT.
11502 (something_changed_gsettingsCB): Rename from something_changedCB.
11503 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11504 also.
11505 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
11506 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
11507 (something_changed_gconfCB): Rename from something_changedCB.
11508 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11509 (parse_settings): Move check for font inside HAVE_XFT.
11510 (read_settings, apply_xft_settings): Add comment.
11511 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11512 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11513 call store_font_name_changed.
11514 (xft_settings_event): Add comment.
11515 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11516 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11517 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11518 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11519 (xsettings_initialize): Call init_gsettings last.
11520 (xsettings_get_system_font, xsettings_get_system_normal_font):
11521 Add comment.
11522
11523 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11524
11525 Random fixes. E.g., (random) never returned negative values.
11526 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11527 subseconds part to the entropy, as that's a bit more random.
11528 Prefer signed to unsigned, since the signedness doesn't matter and
11529 in general we prefer signed. When given a limit, use a
11530 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11531 latter isn't right if USE_2_TAGS_FOR_INTS.
11532 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11533 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11534
11535 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11536
11537 * textprop.c (text_property_stickiness):
11538 Obey Vtext_property_default_nonsticky.
11539 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11540 * w32fns.c (syms_of_w32fns):
11541 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11542
11543 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11544
11545 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11546 This is more efficient than Ffile_directory_p and avoids a minor race.
11547
11548 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11549
11550 * buffer.c (Foverlay_put): Say what the return value is
11551 (bug#7835).
11552
11553 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11554 is a directory before asking whether to use the file name
11555 (bug#7564).
11556 (barf_or_query_if_file_exists): Make the "File is a directory"
11557 error be more correct.
11558
11559 * fns.c (Frequire): Remove the mention of the .gz files, since
11560 that's installation-specific, but keep the mention of
11561 `get-load-suffixes'.
11562
11563 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11564
11565 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11566 Report string overflow if the output is too long.
11567
11568 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
11569
11570 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11571 (syms_of_gnutls): Remove duplicate DEFSYM for
11572 Qgnutls_bootprop_verify_hostname_error, an error for
11573 Qgnutls_bootprop_verify_error (which is no longer used).
11574
11575 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11576 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11577 Also (re)move comments that are misplaced or no longer relevant.
11578
11579 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11580
11581 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11582
11583 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
11584
11585 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11586 and background color parameters if they have been changed.
11587
11588 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11589
11590 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11591
11592 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11593
11594 * xsettings.c (SYSTEM_FONT): Define only when used.
11595 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11596
11597 * keymap.c (access_keymap_1): Now static.
11598
11599 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
11600
11601 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11602 leave any prefix arg for the up event (Bug#1586).
11603
11604 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11605
11606 * lread.c (syms_of_lread): Mention single symbols defined by
11607 `defvar' or `defconst' (bug#7154).
11608
11609 * fns.c (Frequire): Mention .el.gz files (bug#7314).
11610 (Frequire): Mention get-load-suffixes.
11611
11612 2011-07-02 Martin Rudalics <rudalics@gmx.at>
11613
11614 * window.h (window): Remove clone_number slot.
11615 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11616 Remove.
11617 (make_parent_window, make_window, saved_window)
11618 (Fset_window_configuration, save_window_save): Don't deal with
11619 clone numbers.
11620 * buffer.c (Qclone_number): Remove declaration.
11621 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11622
11623 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11624
11625 Add multiple inheritance to keymaps.
11626 * keymap.c (Fmake_composed_keymap): New function.
11627 (Fset_keymap_parent): Simplify.
11628 (fix_submap_inheritance): Remove.
11629 (access_keymap_1): New function extracted from access_keymap to handle
11630 embedded parents and handle lists of maps.
11631 (access_keymap): Use it.
11632 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11633 (Fcopy_keymap): Handle embedded parents.
11634 (Fcommand_remapping, define_as_prefix): Simplify.
11635 (Fkey_binding): Simplify.
11636 (syms_of_keymap): Move minibuffer-local-completion-map,
11637 minibuffer-local-filename-completion-map,
11638 minibuffer-local-must-match-map, and
11639 minibuffer-local-filename-must-match-map to Elisp.
11640 (syms_of_keymap): Defsubr make-composed-keymap.
11641 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11642 (parse_menu_item): Trivial simplification.
11643
11644 2011-07-01 Glenn Morris <rgm@gnu.org>
11645
11646 * Makefile.in (SETTINGS_LIBS): Fix typo.
11647
11648 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11649
11650 * coding.c (Fencode_coding_string): Record the last coding system
11651 used, as the function doc string says (bug#8738).
11652
11653 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11654
11655 * xsettings.c (store_monospaced_changed): Take new font as arg and
11656 check for change against current_mono_font.
11657 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11658 (emacs_settings_constructor, emacs_settings_get_property)
11659 (emacs_settings_set_property, emacs_settings_class_init)
11660 (emacs_settings_init, gsettings_obj): Remove.
11661 (something_changedCB): New function for HAVE_GSETTINGS.
11662 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11663 with value as argument.
11664 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11665 g_settings_new (Bug#8967). Do not create gsettings_obj.
11666 Remove calls to g_settings_bind. Connect something_changedCB to
11667 "changed".
11668
11669 * xgselect.c: Add defined (HAVE_GSETTINGS).
11670 (xgselect_initialize): Ditto.
11671
11672 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11673 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11674 xg_select.
11675
11676 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11677
11678 * eval.c (struct backtrace): Simplify and port the data structure.
11679 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11680 signed bit field, as this assumption is not portable and it makes
11681 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11682 "char debug_on_exit : 1" as this is not portable either; instead,
11683 use the portable "unsigned int debug_on_exit : 1". Remove unused
11684 member evalargs. Remove obsolete comments about cc bombing out.
11685
11686 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11687
11688 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
11689 Let HAVE_GSETTINGS override HAVE_GCONF.
11690 (store_monospaced_changed): New function.
11691 (EMACS_SETTINGS): A new type derived from GObject to handle
11692 GSettings notifications.
11693 (emacs_settings_constructor, emacs_settings_get_property)
11694 (emacs_settings_set_property, emacs_settings_class_init):
11695 New functions.
11696 (gsettings_client, gsettings_obj): New variables.
11697 (GSETTINGS_SCHEMA): New define.
11698 (something_changedCB): Call store_monospaced_changed.
11699 (init_gsettings): New function.
11700 (xsettings_initialize): Call init_gsettings.
11701 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11702 to NULL.
11703
11704 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
11705 GCONF_CFLAGS/LIBS.
11706
11707 2011-06-29 Martin Rudalics <rudalics@gmx.at>
11708
11709 * window.c (resize_root_window, grow_mini_window)
11710 (shrink_mini_window): Rename Qresize_root_window to
11711 Qwindow_resize_root_window and Qresize_root_window_vertically to
11712 Qwindow_resize_root_window_vertically.
11713
11714 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11715
11716 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11717
11718 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
11719
11720 * makefile.w32-in: Redesign dependencies so they reflect more
11721 clearly which files are directly included by each source file,
11722 and not through other includes.
11723
11724 2011-06-27 Martin Rudalics <rudalics@gmx.at>
11725
11726 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11727 (sort_overlays, overlay_strings): When an overlay's clone number
11728 matches the window's clone number process the overlay even if
11729 the overlay's window property doesn't match the current window.
11730
11731 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11732 (Fwindow_hchild): Rename to Fwindow_left_child.
11733 (Fwindow_next): Rename to Fwindow_next_sibling.
11734 (Fwindow_prev): Rename to Fwindow_prev_sibling.
11735 (resize_window_check): Rename to window_resize_check.
11736 (resize_window_apply): Rename to window_resize_apply.
11737 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11738 (Fdelete_other_windows_internal, resize_frame_windows)
11739 (Fsplit_window_internal, Fdelete_window_internal)
11740 (grow_mini_window, shrink_mini_window)
11741 (Fresize_mini_window_internal): Fix callers accordingly.
11742
11743 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11744
11745 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11746 (emacs_fixed_set_min_size): Remove.
11747 (emacs_fixed_new): Take frame as argument.
11748
11749 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11750 (_EmacsFixedPrivate): Remove minwidth/height.
11751 Add struct frame *f.
11752 (emacs_fixed_init): Initialize priv->f.
11753 (get_parent_class, emacs_fixed_set_min_size): Remove.
11754 (emacs_fixed_new): Set priv->f to argument.
11755 (emacs_fixed_get_preferred_width)
11756 (emacs_fixed_get_preferred_height): Use min_width/height from
11757 frames size_hint to set minimum and natural (Bug#8919).
11758 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11759 and use min_width/height from frames size_hint to set
11760 min_width/height (Bug#8919).
11761
11762 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
11763 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11764 Fix indentation.
11765
11766 2011-06-26 Eli Zaretskii <eliz@gnu.org>
11767
11768 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11769 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11770 called at ZV.
11771
11772 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
11773
11774 * process.c (wait_reading_process_output): Bypass select if
11775 waiting for a cell while ignoring keyboard input, and input is
11776 pending. Suggested by Jan Djärv (Bug#8869).
11777
11778 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11779
11780 Use gnulib's dup2 module instead of rolling our own.
11781 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11782
11783 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11784
11785 * dispnew.c (scrolling_window): Before scrolling, turn off a
11786 mouse-highlight in the window being scrolled.
11787
11788 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
11789
11790 Move DEFSYM to lisp.h and use everywhere.
11791
11792 * character.h (DEFSYM): Move declaration...
11793 * lisp.h (DEFSYM): ...here.
11794
11795 * gnutls.c:
11796 * minibuf.c:
11797 * w32menu.c:
11798 * w32proc.c:
11799 * w32select.c: Don't include character.h.
11800
11801 * alloc.c (syms_of_alloc):
11802 * buffer.c (syms_of_buffer):
11803 * bytecode.c (syms_of_bytecode):
11804 * callint.c (syms_of_callint):
11805 * casefiddle.c (syms_of_casefiddle):
11806 * casetab.c (init_casetab_once):
11807 * category.c (init_category_once, syms_of_category):
11808 * ccl.c (syms_of_ccl):
11809 * cmds.c (syms_of_cmds):
11810 * composite.c (syms_of_composite):
11811 * dbusbind.c (syms_of_dbusbind):
11812 * dired.c (syms_of_dired):
11813 * dispnew.c (syms_of_display):
11814 * doc.c (syms_of_doc):
11815 * editfns.c (syms_of_editfns):
11816 * emacs.c (syms_of_emacs):
11817 * eval.c (syms_of_eval):
11818 * fileio.c (syms_of_fileio):
11819 * fns.c (syms_of_fns):
11820 * frame.c (syms_of_frame):
11821 * fringe.c (syms_of_fringe):
11822 * insdel.c (syms_of_insdel):
11823 * keymap.c (syms_of_keymap):
11824 * lread.c (init_obarray, syms_of_lread):
11825 * macros.c (syms_of_macros):
11826 * msdos.c (syms_of_msdos):
11827 * print.c (syms_of_print):
11828 * process.c (syms_of_process):
11829 * search.c (syms_of_search):
11830 * sound.c (syms_of_sound):
11831 * syntax.c (init_syntax_once, syms_of_syntax):
11832 * terminal.c (syms_of_terminal):
11833 * textprop.c (syms_of_textprop):
11834 * undo.c (syms_of_undo):
11835 * w32.c (globals_of_w32):
11836 * window.c (syms_of_window):
11837 * xdisp.c (syms_of_xdisp):
11838 * xfaces.c (syms_of_xfaces):
11839 * xfns.c (syms_of_xfns):
11840 * xmenu.c (syms_of_xmenu):
11841 * xsettings.c (syms_of_xsettings):
11842 * xterm.c (syms_of_xterm): Use DEFSYM.
11843
11844 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11845
11846 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
11847
11848 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11849
11850 Integer and buffer overflow fixes (Bug#8873).
11851
11852 * print.c (printchar, strout): Check for string overflow.
11853 (PRINTPREPARE, printchar, strout):
11854 Don't set size unless allocation succeeds.
11855
11856 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11857 for sizes. Check for string overflow more accurately.
11858 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11859
11860 * macros.c: Integer and buffer overflow fixes.
11861 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11862 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11863 Use ptrdiff_t, not int, for sizes.
11864 Don't increment bufsize until after realloc succeeds.
11865 Check for size-calculation overflow.
11866 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11867
11868 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11869
11870 * lread.c: Integer overflow fixes.
11871 (read_integer): Radix is now EMACS_INT, not int,
11872 to improve quality of diagnostics for out-of-range radices.
11873 Calculate buffer size correctly for out-of-range radices.
11874 (read1): Check for integer overflow in radices, and in
11875 read-circle numbers.
11876 (read_escape): Avoid int overflow.
11877 (Fload, openp, read_buffer_size, read1)
11878 (substitute_object_recurse, read_vector, read_list, map_obarray):
11879 Use ptrdiff_t, not int, for sizes.
11880 (read1): Use EMACS_INT, not int, for sizes.
11881 Check for size overflow.
11882
11883 * image.c (cache_image): Check for size arithmetic overflow.
11884
11885 * lread.c: Integer overflow issues.
11886 (saved_doc_string_size, saved_doc_string_length)
11887 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11888 Now ptrdiff_t, not int.
11889 (read1): Don't assume doc string length fits in int. Check for
11890 out-of-range doc string lengths.
11891 (read_list): Don't assume file position fits in int.
11892 (read_escape): Check for hex character overflow.
11893
11894 2011-06-22 Leo Liu <sdl.web@gmail.com>
11895
11896 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11897 Move to minibuffer.el.
11898
11899 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11900
11901 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
11902 The following patches are for when GLYPH_DEBUG && !XASSERT.
11903 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11904 * dispnew.c (flush_stdout):
11905 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11906 Mark as externally visible.
11907 * dispnew.c (check_window_matrix_pointers): Now static.
11908 * dispnew.c (window_to_frame_vpos):
11909 * xfns.c (unwind_create_frame):
11910 * xterm.c (x_check_font): Remove unused local.
11911 * scroll.c (CHECK_BOUNDS):
11912 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11913 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11914 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11915 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11916 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11917 Now static.
11918 (debug_method_add): Use va_list and vsprintf rather than relying
11919 on undefined behavior with wrong number of arguments.
11920 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11921 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11922 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11923 since we're not interested in debugging glyphs with old libraries.
11924 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11925 GCC 4.6.0's static checking.
11926
11927 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11928
11929 Integer overflow and signedness fixes (Bug#8873).
11930 A few related buffer overrun fixes, too.
11931
11932 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11933
11934 * dispextern.h (struct face.stipple):
11935 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11936 (x_bitmap_mask, x_allocate_bitmap_record)
11937 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11938 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11939 (x_create_bitmap_from_xpm_data):
11940 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11941 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11942 (.bitmaps_last):
11943 * xfaces.c (load_pixmap):
11944 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11945 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11946 (.bitmaps_last, struct x_output.icon_bitmap):
11947 Use ptrdiff_t, not int, for bitmap indexes.
11948 (x_allocate_bitmap_record): Check for size overflow.
11949 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11950
11951 Use ptrdiff_t, not int, for overlay counts.
11952 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11953 * editfns.c (overlays_around, get_pos_property):
11954 * textprop.c (get_char_property_and_overlay):
11955 * xdisp.c (next_overlay_change, note_mouse_highlight):
11956 * xfaces.c (face_at_buffer_position):
11957 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11958 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11959 (Fnext_overlay_change, Fprevious_overlay_change)
11960 (mouse_face_overlay_overlaps, Foverlays_in):
11961 Use ptrdiff_t, not int, for sizes.
11962 (overlays_at, overlays_in): Check for size-calculation overflow.
11963
11964 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11965
11966 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11967 (x_session_initialize): Do not assume string length fits in int.
11968
11969 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11970 This is unlikely, but can occur if DPI is outlandish.
11971
11972 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
11973 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11974
11975 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11976 * xrdb.c (magic_file_p, search_magic_path):
11977 Omit last arg SUFFIX; it was always 0. All callers changed.
11978 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11979
11980 * xfont.c (xfont_match): Avoid need for strlen.
11981
11982 * xfns.c: Don't assume strlen fits in int.
11983 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11984
11985 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11986 not unsigned long, as we prefer signed integers. All callers changed.
11987 Detect integer overflow in repeat count.
11988 (message_dolog): Don't assume print length fits in 39 bytes.
11989 (display_mode_element): Don't assume strlen fits in int.
11990
11991 * termcap.c: Don't assume sizes fit in int and never overflow.
11992 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11993 (gobble_line): Check for size-calculation overflow.
11994
11995 * minibuf.c (Fread_buffer):
11996 * lread.c (intern, intern_c_string):
11997 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11998 Don't assume string length fits in int.
11999
12000 * keyboard.c (parse_tool_bar_item):
12001 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12002
12003 * font.c: Don't assume string length fits in int.
12004 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12005 Use ptrdiff_t, not int.
12006 (font_intern_prop): Don't assume string length fits in int.
12007 Don't assume integer property fits in fixnum.
12008 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12009
12010 * filelock.c: Fix some buffer overrun and integer overflow issues.
12011 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12012 Reformulate so as not to need the command string.
12013 Invoke gzip -cd rather than gunzip, as it's more portable.
12014 (lock_info_type, lock_file_1, lock_file):
12015 Don't assume pid_t and time_t fit in unsigned long.
12016 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12017 (current_lock_owner): Prefer signed type for sizes.
12018 Use memcpy, not strncpy, where memcpy is what is really wanted.
12019 Don't assume (via atoi) that time_t and pid_t fit in int.
12020 Check for time_t and/or pid_t out of range, e.g., via a network share.
12021 Don't alloca where an auto var works fine.
12022
12023 * fileio.c: Fix some integer overflow issues.
12024 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12025 Don't assume string length fits in int.
12026 (directory_file_name): Don't assume string length fits in long.
12027 (make_temp_name): Don't assume pid fits in int, or that its print
12028 length is less than 20.
12029
12030 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12031
12032 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12033
12034 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12035
12036 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12037 We prefer signed integers, even for size calculations.
12038
12039 * emacs.c: Don't assume string length fits in 'int'.
12040 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12041 (main): Don't invoke strlen when not needed.
12042
12043 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12044 (XD_DEBUG_MESSAGE): Don't waste a byte.
12045
12046 * callproc.c (getenv_internal_1, getenv_internal)
12047 (Fgetenv_internal):
12048 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12049
12050 * lread.c (invalid_syntax): Omit length argument.
12051 All uses changed. This doesn't fix a bug, but it simplifies the
12052 code away from its former Hollerith-constant appearance, and it's
12053 one less 'int' to worry about when looking at integer-overflow issues.
12054 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12055
12056 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12057 This didn't break anything, but it didn't help either.
12058 It's confusing to put a bogus integer in a place where the actual
12059 value does not matter.
12060 (LIST_END_P): Remove unused macro and its bogus comment.
12061 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12062
12063 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12064 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12065 implementation.
12066 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12067 We prefer signed types, and the value cannot exceed the EMACS_INT
12068 range anyway (because otherwise the length would not be representable).
12069 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12070 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12071 This avoids a GCC warning when WIDE_EMACS_INT.
12072
12073 * indent.c (sane_tab_width): New function.
12074 (current_column, scan_for_column, Findent_to, position_indentation)
12075 (compute_motion): Use it. This is just for clarity.
12076 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12077
12078 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12079
12080 * lisp.h (lint_assume): New macro.
12081 * composite.c (composition_gstring_put_cache):
12082 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12083
12084 * editfns.c, insdel.c:
12085 Omit unnecessary forward decls, to simplify future changes.
12086
12087 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12088
12089 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12090
12091 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12092 Use much-faster test for byte-length change.
12093 Don't assume string byte-length fits in 'int'.
12094 Check that character arg fits in 'int'.
12095 (mapcar1): Declare byte as byte, for clarity.
12096
12097 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12098
12099 * fns.c (concat): Catch string overflow earlier.
12100 Do not rely on integer wraparound.
12101
12102 * dispextern.h (struct it.overlay_strings_charpos)
12103 (struct it.selective): Now EMACS_INT, not int.
12104 * xdisp.c (forward_to_next_line_start)
12105 (back_to_previous_visible_line_start)
12106 (reseat_at_next_visible_line_start, next_element_from_buffer):
12107 Don't arbitrarily truncate the value of 'selective' to int.
12108
12109 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12110
12111 * composite.c: Don't truncate sizes to 'int'.
12112 (composition_gstring_p, composition_reseat_it)
12113 (composition_adjust_point): Use EMACS_INT, not int.
12114 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12115 not EMACS_UINT, for indexes.
12116
12117 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12118
12119 * buffer.c: Include <verify.h>.
12120 (struct sortvec.priority, struct sortstr.priority):
12121 Now EMACS_INT, not int.
12122 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12123 (struct sortstr.size, record_overlay_string)
12124 (struct sortstrlist.size, struct sortlist.used):
12125 Don't truncate size to int.
12126 (record_overlay_string): Check for size-calculation overflow.
12127 (init_buffer_once): Check at compile-time, not run-time.
12128
12129 2011-06-22 Jim Meyering <meyering@redhat.com>
12130
12131 Don't leak an XBM-image-sized buffer
12132 * image.c (xbm_load): Free the image buffer after using it.
12133
12134 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12135
12136 Port to Sun C.
12137 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12138 that Sun C diagnosed.
12139 * fns.c (secure_hash): Fix pointer signedness issue.
12140 * intervals.c (static_offset_intervals): New function.
12141 (offset_intervals): Use it.
12142
12143 2011-06-21 Leo Liu <sdl.web@gmail.com>
12144
12145 * deps.mk (fns.o):
12146 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12147 sha512.h.
12148
12149 * fns.c (secure_hash): Rename from crypto_hash_function and change
12150 the first arg to accept symbols.
12151 (Fsecure_hash): New primitive.
12152 (syms_of_fns): New symbols.
12153
12154 2011-06-20 Deniz Dogan <deniz@dogan.se>
12155
12156 * process.c (Fset_process_buffer): Clarify return value in
12157 docstring.
12158
12159 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12160
12161 * dispnew.c (add_window_display_history): Use BVAR.
12162
12163 * xdisp.c (debug_method_add): Use BVAR.
12164 (check_window_end, dump_glyph_matrix, dump_glyph)
12165 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12166
12167 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12168 Likewise.
12169
12170 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12171 check till after the cache is created in init_frame_faces.
12172
12173 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12174
12175 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12176
12177 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12178
12179 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12180 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12181 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12182
12183 Improve buffer-overflow checking (Bug#8873).
12184 * fileio.c (Finsert_file_contents):
12185 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12186 Remove the old (too-loose) buffer overflow checks.
12187 They weren't needed, since make_gap checks for buffer overflow.
12188 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12189 The old code merely checked for Emacs fixnum overflow, and relied
12190 on undefined (wraparound) behavior. The new code avoids undefined
12191 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12192
12193 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12194 Tune. Don't use wider integers than needed. Don't use alloca.
12195 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12196
12197 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12198
12199 * insdel.c, lisp.h (buffer_overflow): New function.
12200 (insert_from_buffer_1, replace_range, replace_range_2):
12201 * insdel.c (make_gap_larger):
12202 * editfns.c (Finsert_char):
12203 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12204
12205 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12206
12207 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12208
12209 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12210
12211 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12212 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12213
12214 * fileio.c: Don't assume EMACS_INT fits in off_t.
12215 (emacs_lseek): New static function.
12216 (Finsert_file_contents, Fwrite_region): Use it.
12217 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12218
12219 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12220
12221 * fns.c: Don't overflow int when computing a list length.
12222 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12223 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12224 truncation on 64-bit hosts. Check for QUIT every
12225 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12226 faster and is responsive enough.
12227 (Flength): Report an error instead of overflowing an integer.
12228 (Fsafe_length): Return a float if the value is not representable
12229 as a fixnum. This shouldn't happen except in contrived situations.
12230 (Fnthcdr, Fsort): Don't assume list length fits in int.
12231 (Fcopy_sequence): Don't assume vector length fits in int.
12232
12233 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12234 (header_size, word_size): New constants.
12235 (allocate_vectorlike): Don't check size overflow here.
12236 (allocate_vector): Check it here instead, since this is the only
12237 caller of allocate_vectorlike that could cause overflow.
12238 Check that the new vector's length is representable as a fixnum.
12239
12240 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12241 The previous code was bogus. For example, next_almost_prime (32)
12242 returned 39, which is undesirable as it is a multiple of 3; and
12243 next_almost_prime (24) returned 25, which is a multiple of 5 so
12244 why was the code bothering to check for multiples of 7?
12245
12246 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12247
12248 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12249
12250 Variadic C functions now count arguments with ptrdiff_t.
12251 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12252 Back then I didn't know that the Emacs coding style prefers signed int.
12253 Also, in the meantime I found a few more instances where arguments
12254 were being counted with int, which may truncate counts on 64-bit
12255 machines, or EMACS_INT, which may be unnecessarily wide.
12256 * lisp.h (struct Lisp_Subr.function.aMANY)
12257 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12258 Arg counts are now ptrdiff_t, not size_t.
12259 All variadic functions and their callers changed accordingly.
12260 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12261 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12262 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12263 * callint.c (Fcall_interactively): Check arg count for overflow,
12264 to avoid potential buffer overrun. Use signed char, not 'int',
12265 for 'varies' array, so that we needn't bother to check its size
12266 calculation for overflow.
12267 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12268 * eval.c (apply_lambda):
12269 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12270 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12271 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12272
12273 * callint.c (Fcall_interactively): Don't use index var as event count.
12274
12275 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12276 * mem-limits.h (SIZE): Remove; no longer used.
12277
12278 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12279
12280 Remove unnecessary casts.
12281 * xterm.c (x_term_init):
12282 * xfns.c (x_set_border_pixel):
12283 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12284 These aren't needed now that we assume ANSI C.
12285
12286 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12287 It's more likely to cause problems (due to unsigned overflow)
12288 than to cure them.
12289
12290 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12291
12292 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12293
12294 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12295
12296 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12297
12298 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12299
12300 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12301
12302 GLYPH_CODE_FACE returns EMACS_INT, not int.
12303 * dispextern.h (merge_faces):
12304 * xfaces.c (merge_faces):
12305 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12306 Don't assume EMACS_INT fits in int.
12307
12308 * character.h (CHAR_VALID_P): Remove unused parameter.
12309 * fontset.c, lisp.h, xdisp.c: All uses changed.
12310
12311 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12312
12313 * fns.c (concat): Minor tuning based on overflow analysis.
12314 This doesn't fix any bugs. Use int to hold character, instead
12315 of constantly refetching from Emacs object. Use XFASTINT, not
12316 XINT, for value known to be a character. Don't bother comparing
12317 a single byte to 0400, as it's always less.
12318
12319 * floatfns.c (Fexpt):
12320 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12321
12322 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12323 for characters.
12324
12325 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12326
12327 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12328 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12329 incorrectly succeed when S was a string, because 4294967386 was
12330 truncated before it was used.
12331
12332 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12333 Otherwise, an out-of-range integer could cause undefined behavior
12334 on a 64-bit host.
12335
12336 * composite.c: Use int, not EMACS_INT, for characters.
12337 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12338 EMACS_INT, for values that are known to be in character range.
12339 This doesn't fix any bugs but is the usual style inside Emacs and
12340 may generate better code on 32-bit machines.
12341
12342 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12343 This is for reasons similar to the recent CHAR_STRING fix.
12344 * charset.c (Fencode_char): Check that character arg is actually
12345 a character. Pass an int to ENCODE_CHAR.
12346 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12347 wider than 'int', as a compile-time check to prevent future regressions
12348 in this area.
12349
12350 * character.c (char_string): Remove unnecessary casts.
12351
12352 Make sure a 64-bit char is never passed to CHAR_STRING.
12353 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12354 by silently ignoring the top 32 bits, allowing some values
12355 that were far too large to be valid characters.
12356 * character.h: Include <verify.h>.
12357 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12358 arguments are no wider than unsigned, as a compile-time check
12359 to prevent future regressions in this area.
12360 * data.c (Faset):
12361 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12362 (Fsubst_char_in_region):
12363 * fns.c (concat):
12364 * xdisp.c (decode_mode_spec_coding):
12365 Adjust to CHAR_STRING's new requirement.
12366 * editfns.c (Finsert_char, Fsubst_char_in_region):
12367 * fns.c (concat): Check that character args are actually
12368 characters. Without this test, these functions did the wrong
12369 thing with wildly out-of-range values on 64-bit hosts.
12370
12371 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12372 These casts should not be needed on 32-bit hosts, either.
12373 * keyboard.c (read_char):
12374 * lread.c (Fload): Remove casts to unsigned.
12375
12376 * lisp.h (UNSIGNED_CMP): New macro.
12377 This fixes comparison bugs on 64-bit hosts.
12378 (ASCII_CHAR_P): Use it.
12379 * casefiddle.c (casify_object):
12380 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
12381 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12382 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12383 * dispextern.h (FACE_FROM_ID):
12384 * keyboard.c (read_char): Use UNSIGNED_CMP.
12385
12386 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12387 not to EMACS_INT, to avoid GCC warning.
12388
12389 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12390
12391 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12392 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12393 isn't needed on 32-bit machines.
12394
12395 * buffer.c (Fgenerate_new_buffer_name):
12396 Use EMACS_INT for count, not int.
12397 (advance_to_char_boundary): Return EMACS_INT, not int.
12398
12399 * data.c (Qcompiled_function): Now static.
12400
12401 * window.c (window_body_lines): Now static.
12402
12403 * image.c (gif_load): Rename local to avoid shadowing.
12404
12405 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12406 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12407 * alloc.c (make_save_value): Integer argument is now of type
12408 ptrdiff_t, not int.
12409 (mark_object): Use ptrdiff_t, not int.
12410 * lisp.h (pD): New macro.
12411 * print.c (print_object): Use it.
12412
12413 * alloc.c: Use EMACS_INT, not int, to count objects.
12414 (total_conses, total_markers, total_symbols, total_vector_size)
12415 (total_free_conses, total_free_markers, total_free_symbols)
12416 (total_free_floats, total_floats, total_free_intervals)
12417 (total_intervals, total_strings, total_free_strings):
12418 Now EMACS_INT, not int. All uses changed.
12419 (Fgarbage_collect): Compute overall total using a double, so that
12420 integer overflow is less likely to be a problem. Check for overflow
12421 when converting back to an integer.
12422 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12423 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12424 These were 'int' variables that could overflow on 64-bit hosts;
12425 they were never used, so remove them instead of repairing them.
12426 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
12427 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12428 Previously, this ceilinged at INT_MAX, but that doesn't work on
12429 64-bit machines.
12430 (allocate_pseudovector): Don't use EMACS_INT when int would do.
12431
12432 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
12433 (allocate_vectorlike): Check for ptrdiff_t overflow.
12434 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12435 when a (possibly-narrower) signed value would do just as well.
12436 We prefer using signed arithmetic, to avoid comparison confusion.
12437
12438 * alloc.c: Catch some string size overflows that we were missing.
12439 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12440 for convenience in STRING_BYTES_MAX.
12441 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12442 The definition here is exact; the one in lisp.h was approximate.
12443 (allocate_string_data): Check for string overflow. This catches
12444 some instances we weren't catching before. Also, it catches
12445 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12446 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12447 and ptrdiff_t and EMACS_INT are both 64 bits.
12448
12449 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12450 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
12451 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
12452
12453 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12454
12455 * alloc.c (Fmake_string): Check for out-of-range init.
12456
12457 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12458
12459 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12460
12461 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12462
12463 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12464 xg_get_default_scrollbar_width.
12465
12466 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12467 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12468 (style_changed_cb): Call update_theme_scrollbar_width and call
12469 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12470 all frames (Bug#8505).
12471 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12472 Call gtk_window_set_resizable if HAVE_GTK3.
12473 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12474 and height if HAVE_GTK3 (Bug#8505).
12475 (scroll_bar_width_for_theme): New variable.
12476 (update_theme_scrollbar_width): New function.
12477 (xg_get_default_scrollbar_width): Move code to
12478 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12479 (xg_initialize): Call update_theme_scrollbar_width.
12480
12481 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12482
12483 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12484
12485 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12486
12487 * frame.c (make_frame): Call other_buffer_safely instead of
12488 other_buffer.
12489
12490 * window.c (temp_output_buffer_show): Call display_buffer with
12491 second argument Vtemp_buffer_show_specifiers and reset latter
12492 immediately after the call.
12493 (Vtemp_buffer_show_specifiers): New variable.
12494 (auto_window_vscroll_p, next_screen_context_lines)
12495 (Vscroll_preserve_screen_position): Remove leading asterisks from
12496 doc-strings.
12497
12498 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
12499
12500 Fix minor problems found by GCC 4.6.0 static checking.
12501 * buffer.c (Qclone_number): Remove for now, as it's unused.
12502 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12503 (record_buffer): Remove unused local.
12504 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12505 (set_frame_buffer_list): Remove; unused.
12506 * frame.h (other_visible_frames): Remove decl.
12507 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12508 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12509 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12510 if HAVE_GPM.
12511 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12512 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12513 Define only if HAVE_GPM.
12514 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12515 (update_hints_inhibit): Remove; never set. All uses removed.
12516 * widgetprv.h (emacsFrameClassRec): Remove decl.
12517 * window.c (delete_deletable_window): Now returns void, since it
12518 wasn't returning anything.
12519 (compare_window_configurations): Remove unused locals.
12520 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12521 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
12522 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12523 the same widths as pointers. This follows up on the 2011-05-06 patch.
12524 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12525 * xterm.h: Likewise.
12526 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12527
12528 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
12529
12530 * makefile.w32-in: Update dependencies.
12531 (LISP_H): Add lib/intprops.h.
12532
12533 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12534
12535 * image.c (gif_load): Add animation frame delay to the metadata.
12536 (syms_of_image): Use DEFSYM. New symbol `delay'.
12537
12538 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12539
12540 * window.c (delete_deletable_window): Re-add.
12541 (Fset_window_configuration): Rewrite to handle dead buffers and
12542 consequently deletable windows.
12543 (window_tree, Fwindow_tree): Remove. Supply functionality in
12544 window.el.
12545 (compare_window_configurations): Simplify code.
12546
12547 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12548
12549 * image.c (imagemagick_load_image): Fix type mismatch.
12550 (Fimagemagick_types): Likewise.
12551
12552 * window.h (replace_buffer_in_windows): Declare.
12553
12554 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12555
12556 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12557 Qclone_number. Remove external declaration of Qdelete_window.
12558 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12559 code.
12560 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12561 Run Qbuffer_list_update_hook if allowed.
12562 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12563 buffer list implementation.
12564 (other_buffer_safely): New function.
12565 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12566 calls to replace_buffer_in_windows and
12567 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12568 if allowed.
12569 (record_buffer): Inhibit quitting and rewrite using quittable
12570 functions. Run Qbuffer_list_update_hook if allowed.
12571 (Frecord_buffer, Funrecord_buffer): New functions.
12572 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12573 Move switch-to-buffer to window.el.
12574 (bury-buffer): Move to window.el.
12575 (Vbuffer_list_update_hook): New variable.
12576
12577 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12578 section.
12579
12580 * window.h (resize_frame_windows): Move up in code.
12581 (Fwindow_frame): Remove EXFUN.
12582 (replace_buffer_in_all_windows): Remove prototype.
12583 (replace_buffer_in_windows_safely): Add prototype.
12584
12585 * window.c: Declare Qdelete_window static again. Move down
12586 declaration of select_count.
12587 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12588 (Fother_window): Move to window.el.
12589 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12590 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12591 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12592 window.el.
12593 (replace_buffer_in_windows): Implement by calling
12594 Qreplace_buffer_in_windows.
12595 (replace_buffer_in_all_windows): Remove with some functionality
12596 moved into replace_buffer_in_windows_safely.
12597 (replace_buffer_in_windows_safely): New function.
12598 (select_window_norecord, select_frame_norecord): Move in front
12599 of run_window_configuration_change_hook. Remove now obsolete
12600 declarations.
12601 (Fset_window_buffer): Rewrite doc-string.
12602 Call Qrecord_window_buffer.
12603 (keys_of_window): Move binding for other-window to window.el.
12604
12605 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12606
12607 * dispextern.h (struct image): Replace data member, whose int_val
12608 and ptr_val fields were not used by anything, with a single
12609 lisp_val object.
12610
12611 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12612 (gif_clear_image, gif_load, imagemagick_load_image)
12613 (gs_clear_image, gs_load): Callers changed.
12614
12615 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12616
12617 * buffer.h: Include <time.h>, for time_t.
12618 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12619
12620 Fix minor problems found by static checking.
12621
12622 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12623
12624 Make identifiers static if they are not used in other modules.
12625 * data.c (Qcompiled_function, Qframe, Qvector):
12626 * image.c (QimageMagick, Qsvg):
12627 * minibuf.c (Qmetadata):
12628 * window.c (resize_window_check, resize_root_window): Now static.
12629 * window.h (resize_window_check, resize_root_window): Remove decls.
12630
12631 * window.c (window_deletion_count, delete_deletable_window):
12632 Remove; unused.
12633 (window_body_lines): Now static.
12634 (Fdelete_other_windows_internal): Mark vars as initialized.
12635 Make sure 'resize_failed' is initialized.
12636 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12637 (resize_window_apply): Remove unused local.
12638 * window.h (delete_deletable_window): Remove decl.
12639
12640 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
12641 (imagemagick_load_image): Fix pointer signedness problem by changing
12642 last arg from unsigned char * to char *. All uses changed.
12643 Also, fix a local for similar reasons.
12644 Remove unused locals. Remove locals to avoid shadowing.
12645 (fn_rsvg_handle_free): Remove; unused.
12646 (svg_load, svg_load_image): Fix pointer signedness problem.
12647 (imagemagick_load_image): Don't use garbage pointer image_wand.
12648
12649 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12650
12651 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
12652
12653 * image.c (gif_load): Fix omitted cast error introduced by
12654 2011-06-06 change.
12655
12656 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12657
12658 * window.h (resize_proportionally, orig_total_lines)
12659 (orig_top_line): Remove from window structure.
12660 (set_window_height, set_window_width, change_window_heights)
12661 (Fdelete_window): Remove prototypes.
12662 (resize_frame_windows): Remove duplicate declaration.
12663
12664 2011-06-10 Eli Zaretskii <eliz@gnu.org>
12665
12666 * window.h (resize_frame_windows, resize_window_check)
12667 (delete_deletable_window, resize_root_window)
12668 (resize_frame_windows): Declare prototypes.
12669
12670 * window.c (resize_window_apply): Make definition be "static" to
12671 match the prototype.
12672
12673 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12674
12675 * window.c: Remove declarations of Qwindow_size_fixed,
12676 window_min_size_1, window_min_size_2, window_min_size,
12677 size_window, window_fixed_size_p, enlarge_window, delete_window.
12678 Remove static from declaration of Qdelete_window, it's
12679 temporarily needed by Fbury_buffer.
12680 (replace_window): Don't assign orig_top_line and
12681 orig_total_lines.
12682 (Fdelete_window, delete_window): Remove. Window deletion is
12683 handled by window.el.
12684 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12685 Replace Fdelete_window calls with calls to Qdelete_window.
12686 (Fdelete_other_windows): Remove. Deleting other windows is
12687 handled by window.el.
12688 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12689 handled in window.el.
12690 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12691 Window minimum sizes are handled in window.el.
12692 (shrink_windows, size_window, set_window_height)
12693 (set_window_width, change_window_heights, window_height)
12694 (window_width, CURBEG, CURSIZE, enlarge_window)
12695 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12696 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12697 handled in window.el.
12698 (make_dummy_parent): Rename to make_parent_window and give it a
12699 second argument horflag.
12700 (make_window): Don't set resize_proportionally any more.
12701 (Fsplit_window): Remove. Windows are split in window.el.
12702 (save_restore_action, save_restore_orig_size)
12703 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12704 Resize mini windows in window.el.
12705 (grow_mini_window, shrink_mini_window): Implement by calling
12706 Qresize_root_window_vertically, resize_window_check and
12707 resize_window_apply.
12708 (saved_window, Fset_window_configuration, save_window_save):
12709 Do not handle orig_top_line, orig_total_lines, and
12710 resize_proportionally.
12711 (window_min_height, window_min_width): Move to window.el.
12712 (keys_of_window): Move bindings for delete-other-windows,
12713 split-window, delete-window and enlarge-window to window.el.
12714
12715 * buffer.c: Temporarily extern Qdelete_window.
12716 (Fbury_buffer): Temporarily call Qdelete_window instead of
12717 Fdelete_window (Fbury_buffer will move to window.el soon).
12718
12719 * frame.c (set_menu_bar_lines_1): Remove code handling
12720 orig_top_line and orig_total_lines.
12721
12722 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12723 set_window_height but set heights directly.
12724 (change_frame_size_1): Use resize_frame_windows.
12725
12726 * xdisp.c (init_xdisp): Don't use set_window_height but set
12727 heights directly.
12728
12729 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12730 Use resize_frame_windows instead of change_window_heights and run
12731 run_window_configuration_change_hook.
12732
12733 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12734 instead of change_window_heights and run
12735 run_window_configuration_change_hook.
12736
12737 2011-06-09 Martin Rudalics <rudalics@gmx.at>
12738
12739 * window.c (replace_window): Rename second argument REPLACEMENT to
12740 NEW. New third argument SETFLAG. Rewrite.
12741 (delete_window, make_dummy_parent): Call replace_window with
12742 third argument 1.
12743 (window_list_1): Move down in code.
12744 (run_window_configuration_change_hook): Move set_buffer part
12745 before select_frame_norecord part in order to unwind correctly.
12746 Rename count1 to count.
12747 (recombine_windows, delete_deletable_window, resize_root_window)
12748 (Fdelete_other_windows_internal)
12749 (Frun_window_configuration_change_hook, make_parent_window)
12750 (resize_window_check, resize_window_apply, Fresize_window_apply)
12751 (resize_frame_windows, Fsplit_window_internal)
12752 (Fdelete_window_internal, Fresize_mini_window_internal):
12753 New functions.
12754 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12755
12756 2011-06-08 Martin Rudalics <rudalics@gmx.at>
12757
12758 * window.h (window): Add some new members to window structure -
12759 normal_lines, normal_cols, new_total, new_normal, clone_number,
12760 splits, nest, prev_buffers, next_buffers.
12761 (WINDOW_TOTAL_SIZE): Move here from window.c.
12762 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
12763
12764 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12765 Remove.
12766 (make_dummy_parent): Set new members of windows structure.
12767 (make_window): Move down in code. Handle new members of window
12768 structure.
12769 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12770 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12771 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12772 (Fset_window_prev_buffers, Fwindow_next_buffers)
12773 (Fset_window_next_buffers, Fset_window_clone_number):
12774 New functions.
12775 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12776 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12777 Doc-string fixes.
12778 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12779 Argument WINDOW can be now internal window too.
12780 (Fwindow_use_time): Move up in code.
12781 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12782 Rewrite doc-string.
12783 (Fset_window_configuration, saved_window)
12784 (Fcurrent_window_configuration, save_window_save): Handle new
12785 members of window structure.
12786 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12787 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12788 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12789 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12790 Qget_mru_window, Qresize_root_window,
12791 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12792 Qauto_buffer_name; staticpro them.
12793
12794 2011-06-07 Martin Rudalics <rudalics@gmx.at>
12795
12796 * window.c (Fwindow_total_size, Fwindow_left_column)
12797 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12798 (Fwindow_list_1): New functions.
12799 (window_box_text_cols): Replace with window_body_cols.
12800 (Fwindow_width, Fscroll_left, Fscroll_right):
12801 Use window_body_cols instead of window_box_text_cols.
12802 (delete_window, Fset_window_configuration):
12803 Call delete_all_subwindows with window as argument.
12804 (delete_all_subwindows): Take a window as argument and not a
12805 structure. Rewrite.
12806 (window_loop): Remove handling of GET_LRU_WINDOW and
12807 GET_LARGEST_WINDOW.
12808 (Fget_lru_window, Fget_largest_window): Move to window.el.
12809
12810 * window.h: Extern window_body_cols instead of
12811 window_box_text_cols. delete_all_subwindows now takes a
12812 Lisp_Object as argument.
12813
12814 * indent.c (compute_motion, Fcompute_motion):
12815 Use window_body_cols instead of window_box_text_cols.
12816
12817 * frame.c (delete_frame): Call delete_all_subwindows with root
12818 window as argument.
12819
12820 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12821
12822 * fns.c (Fputhash): Document return value.
12823
12824 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
12825
12826 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12827
12828 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12829
12830 Cons<->int and similar integer overflow fixes (Bug#8794).
12831
12832 Check for overflow when converting integer to cons and back.
12833 * charset.c (Fdefine_charset_internal, Fdecode_char):
12834 Use cons_to_unsigned to catch overflow.
12835 (Fencode_char): Use INTEGER_TO_CONS.
12836 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12837 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12838 * data.c (long_to_cons, cons_to_long): Remove.
12839 (cons_to_unsigned, cons_to_signed): New functions.
12840 These signal an error for invalid or out-of-range values.
12841 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12842 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12843 * font.c (Ffont_variation_glyphs):
12844 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12845 * lisp.h: Include <intprops.h>.
12846 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12847 (cons_to_signed, cons_to_unsigned): New decls.
12848 (long_to_cons, cons_to_long): Remove decls.
12849 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12850 (Fprimitive_undo): Use CONS_TO_INTEGER.
12851 * xfns.c (Fx_window_property): Likewise.
12852 * xselect.c: Include <limits.h>.
12853 (x_own_selection, selection_data_to_lisp_data):
12854 Use INTEGER_TO_CONS.
12855 (x_handle_selection_request, x_handle_selection_clear)
12856 (x_get_foreign_selection, Fx_disown_selection_internal)
12857 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12858 (lisp_data_to_selection_data): Use cons_to_unsigned.
12859 (x_fill_property_data): Use cons_to_signed.
12860 Report values out of range.
12861
12862 Check for buffer and string overflow more precisely.
12863 * buffer.h (BUF_BYTES_MAX): New macro.
12864 * lisp.h (STRING_BYTES_MAX): New macro.
12865 * alloc.c (Fmake_string):
12866 * character.c (string_escape_byte8):
12867 * coding.c (coding_alloc_by_realloc):
12868 * doprnt.c (doprnt):
12869 * editfns.c (Fformat):
12870 * eval.c (verror):
12871 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12872 since they may not be the same number.
12873 * editfns.c (Finsert_char):
12874 * fileio.c (Finsert_file_contents):
12875 Likewise for BUF_BYTES_MAX.
12876
12877 * image.c: Use ptrdiff_t, not int, for sizes.
12878 (slurp_file): Switch from int to ptrdiff_t.
12879 All uses changed.
12880 (slurp_file): Check that file size fits in both size_t (for
12881 malloc) and ptrdiff_t (for sanity and safety).
12882
12883 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12884 if b->modtime has its maximal value.
12885
12886 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12887
12888 Don't assume time_t can fit into int.
12889 * buffer.h (struct buffer.modtime): Now time_t, not int.
12890 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12891 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12892
12893 Minor fixes for signed vs unsigned integers.
12894 * character.h (MAYBE_UNIFY_CHAR):
12895 * charset.c (maybe_unify_char):
12896 * keyboard.c (read_char, reorder_modifiers):
12897 XINT -> XFASTINT, since the integer must be nonnegative.
12898 * ftfont.c (ftfont_spec_pattern):
12899 * keymap.c (access_keymap, silly_event_symbol_error):
12900 XUINT -> XFASTINT, since the integer must be nonnegative.
12901 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12902 since it makes no difference and we prefer signed.
12903 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12904 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12905 nonnegative.
12906
12907 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12908
12909 * window.h (Fwindow_frame): Declare.
12910
12911 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12912
12913 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12914 (SPARE_MEMORY): Always define.
12915 (LARGE_REQUEST): Remove.
12916 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12917
12918 2011-06-06 Martin Rudalics <rudalics@gmx.at>
12919
12920 * lisp.h: Move EXFUNS for Fframe_root_window,
12921 Fframe_first_window and Fset_frame_selected_window to window.h.
12922
12923 * window.h: Move EXFUNS for Fframe_root_window,
12924 Fframe_first_window and Fset_frame_selected_window here from
12925 lisp.h.
12926
12927 * frame.c (Fwindow_frame, Fframe_first_window)
12928 (Fframe_root_window, Fframe_selected_window)
12929 (Fset_frame_selected_window): Move to window.c.
12930 (Factive_minibuffer_window): Move to minibuf.c.
12931 (Fother_visible_frames_p): New function.
12932
12933 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12934
12935 * window.c (decode_window, decode_any_window): Move up in code.
12936 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12937 (inhibit_frame_unsplittable): Remove unused variable.
12938 (Fwindow_buffer): Move up and rewrite doc-string.
12939 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12940 (Fwindow_prev): New functions.
12941 (Fwindow_frame): Move here from frame.c. Accept any window as
12942 argument.
12943 (Fframe_root_window, Fframe_first_window)
12944 (Fframe_selected_window): Move here from frame.c. Accept frame
12945 or arbitrary window as argument. Update doc-strings.
12946 (Fminibuffer_window): Move up in code.
12947 (Fwindow_minibuffer_p): Move up in code and simplify.
12948 (Fset_frame_selected_window): Move here from frame.c.
12949 Marginal rewrite.
12950 (Fselected_window, select_window, Fselect_window): Move up in
12951 code. Minor doc-string fixes.
12952
12953 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12954
12955 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12956 Do not assume that spare memory exists; that assumption is valid
12957 only if SYSTEM_MALLOC.
12958 (LARGE_REQUEST): New macro, so that the issue of large requests
12959 is separated from the issue of spare memory.
12960
12961 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12962
12963 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12964 format. (Bug#8806)
12965
12966 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12967
12968 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12969 before statements.
12970
12971 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12972
12973 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12974
12975 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12976
12977 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12978 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12979
12980 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
12981
12982 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12983
12984 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
12985
12986 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12987 (x_clipboard_manager_save): Add return value.
12988 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12989 New error handlers.
12990 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12991 Obey Vx_select_enable_clipboard_manager. Catch errors in
12992 x_clipboard_manager_save (Bug#8779).
12993 (Vx_select_enable_clipboard_manager): New variable.
12994 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
12995
12996 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
12997
12998 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12999
13000 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13001
13002 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13003 in the current matrix if keep_current_p is non-zero.
13004
13005 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13006
13007 * bidi.c (bidi_level_of_next_char): Fix last change.
13008
13009 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13010
13011 Support bidi reordering of text covered by display properties.
13012
13013 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13014 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13015 (bidi_cache_search, bidi_cache_iterator_state)
13016 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13017 (bidi_level_of_next_char, bidi_move_to_visually_next):
13018 Support character positions inside a run of characters covered by a
13019 display string.
13020 (bidi_paragraph_init, bidi_resolve_explicit_1)
13021 (bidi_level_of_next_char): Call bidi_fetch_char and
13022 bidi_fetch_char_advance instead of FETCH_CHAR and
13023 FETCH_CHAR_ADVANCE.
13024 (bidi_init_it): Initialize new members.
13025 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13026 definitions.
13027 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13028 instead of using explicit *_CHAR codes.
13029 (bidi_resolve_explicit, bidi_resolve_weak):
13030 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13031 bidirectional text is supported only in multibyte buffers.
13032 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13033 it to initialize the frame_window_p member of struct bidi_it.
13034 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13035 (bidi_resolve_explicit, bidi_resolve_weak)
13036 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13037 bidi_it->nchars is non-positive.
13038 (bidi_level_of_next_char): Don't try to lookup the cache for the
13039 next/previous character if nothing is cached there yet, or if we
13040 were just reseat()'ed to a new position.
13041
13042 * xdisp.c (set_cursor_from_row): Set start and stop points
13043 according to the row's direction when priming the loop that looks
13044 for the glyph on which to display cursor.
13045 (single_display_spec_intangible_p): Function deleted.
13046 (display_prop_intangible_p): Reimplement to call
13047 handle_display_spec instead of single_display_spec_intangible_p.
13048 Accept 3 additional arguments needed by handle_display_spec.
13049 This fixes incorrect cursor motion across display property with complex
13050 values: lists, `(when COND...)' forms, etc.
13051 (single_display_spec_string_p): Support property values that are
13052 lists with the argument STRING its top-level element.
13053 (display_prop_string_p): Fix the condition for processing a
13054 property that is a list to be consistent with handle_display_spec.
13055 (handle_display_spec): New function, refactored from the
13056 last portion of handle_display_prop.
13057 (compute_display_string_pos): Accept additional argument
13058 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13059 value of a `display' property is a "replacing spec".
13060 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13061 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13062 the display property, but just return a value indicating whether
13063 the display property will replace the characters it covers.
13064 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13065 frame_window_p members of struct bidi_it.
13066 (compute_display_string_pos, compute_display_string_end):
13067 New functions.
13068 (push_it): Accept second argument POSITION, where pop_it should
13069 jump to continue iteration.
13070 (reseat_1): Initialize bidi_it.disp_pos.
13071
13072 * keyboard.c (adjust_point_for_property): Adjust the call to
13073 display_prop_intangible_p to its new signature.
13074
13075 * dispextern.h (struct bidi_it): New member frame_window_p.
13076 (bidi_init_it): Update prototypes.
13077 (display_prop_intangible_p): Update prototype.
13078 (compute_display_string_pos, compute_display_string_end):
13079 Declare prototypes.
13080 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13081 EMACS_INT.
13082
13083 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13084
13085 Malloc failure behavior now depends on size of allocation.
13086 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13087 * lisp.h: Change signatures accordingly.
13088 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13089 All callers changed. (Bug#8762)
13090
13091 * gnutls.c: Use Emacs's memory allocators.
13092 Without this change, the gnutls library would invoke malloc etc.
13093 directly, which causes problems on non-SYNC_INPUT hosts, and which
13094 runs afoul of improving memory_full behavior. (Bug#8761)
13095 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13096 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13097 xfree instead of the default malloc, realloc, free.
13098 (Fgnutls_boot): No need to check for memory allocation failure,
13099 since xmalloc does that for us.
13100
13101 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13102 * category.c (hash_get_category_set):
13103 * ccl.c (ccl_driver):
13104 * charset.c (Fdefine_charset_internal):
13105 * charset.h (struct charset.hash_index):
13106 * composite.c (get_composition_id, gstring_lookup_cache)
13107 (composition_gstring_put_cache):
13108 * composite.h (struct composition.hash_index):
13109 * dispextern.h (struct image.hash):
13110 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13111 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13112 (hashfn_equal, hashfn_user_defined, make_hash_table)
13113 (maybe_resize_hash_table, hash_lookup, hash_put)
13114 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13115 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13116 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13117 * image.c (make_image, search_image_cache, lookup_image)
13118 (xpm_put_color_table_h):
13119 * lisp.h (struct Lisp_Hash_Table):
13120 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13121 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13122 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13123 * alloc.c (allocate_vectorlike):
13124 Check for overflow in vector size calculations.
13125 * ccl.c (ccl_driver):
13126 Check for overflow when converting EMACS_INT to int.
13127 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13128 need to be updated by these changes.
13129 * fns.c (make_hash_table, maybe_resize_hash_table):
13130 Check for integer overflow with large hash tables.
13131 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13132 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13133 (SXHASH_REDUCE): New macro.
13134 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13135 Use it instead of discarding useful hash info with large hash values.
13136 (sxhash_float): New function.
13137 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13138 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13139 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13140 Rewrite to use FIXNUM_BITS, as this simplifies things.
13141 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13142 Adjust signatures to match updated version of code.
13143 (consing_since_gc): Now EMACS_INT, since a single hash table can
13144 use more than INT_MAX bytes.
13145
13146 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13147
13148 Make it possible to build with GCC-4.6+ -O2 -flto.
13149
13150 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13151
13152 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13153
13154 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13155 Call minibuffer-inactive-mode.
13156
13157 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13158
13159 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13160 Update dependencies.
13161
13162 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13163
13164 * data.c (init_data): Remove code for UTS, this system is not
13165 supported anymore.
13166
13167 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13168
13169 Don't force ./temacs to start in terminal mode.
13170
13171 * frame.c (make_initial_frame): Initialize faces in all cases, not
13172 only when CANNOT_DUMP is defined.
13173 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13174
13175 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13176
13177 * dispnew.c (add_window_display_history): Use const for the string
13178 pointer. Remove declaration, not needed.
13179
13180 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13181
13182 Use 'inline', not 'INLINE'.
13183 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13184 * alloc.c, fontset.c (INLINE): Remove.
13185 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13186 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13187 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13188 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13189 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13190
13191 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13192
13193 Make it possible to run ./temacs.
13194
13195 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13196 syms_of_callproc does the same thing. Remove test for
13197 "initialized", do it in the caller.
13198 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13199
13200 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13201
13202 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13203 (read_minibuf): Use get_minibuffer.
13204 (syms_of_minibuf): Use DEFSYM.
13205 (Qmetadata): New var.
13206 * data.c (Qbuffer): Don't make it static.
13207 (syms_of_data): Use DEFSYM.
13208
13209 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13210
13211 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13212 (CCL_CODE_MIN): New macro.
13213
13214 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13215
13216 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13217
13218 * eval.c (Qdebug): Now static.
13219 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13220 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13221 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13222
13223 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13224
13225 * image.c: Various fixes to ImageMagick code comments.
13226 (Fimagemagick_types): Doc fix.
13227
13228 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13229
13230 Minor fixes prompted by GCC 4.6.0 warnings.
13231
13232 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13233
13234 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13235 (x_clipboard_manager_save_all): Move extern decl to ...
13236 * xterm.h: ... here, so that it can be checked for consistency.
13237
13238 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13239
13240 * xselect.c (x_clipboard_manager_save_frame)
13241 (x_clipboard_manager_save_all): New functions.
13242 (Fx_clipboard_manager_save): Lisp function deleted.
13243
13244 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13245 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13246
13247 * xterm.h: Update prototype.
13248
13249 2011-05-28 William Xu <william.xwl@gmail.com>
13250
13251 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13252 exiting (Bug#8239).
13253
13254 2011-05-28 Jim Meyering <meyering@redhat.com>
13255
13256 Avoid a sign-extension bug in crypto_hash_function.
13257 * fns.c (to_uchar): Define.
13258 (crypto_hash_function): Use it to convert some newly-signed
13259 variables to unsigned, to avoid sign-extension bugs. For example,
13260 without this change, (md5 "truc") would evaluate to
13261 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13262 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13263 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13264
13265 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13266
13267 Integer overflow fixes.
13268
13269 * dbusbind.c: Serial number integer overflow fixes.
13270 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13271 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13272 to hold a serial number that is too large for a fixnum.
13273 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13274 Check for serial numbers out of range. Decode any serial number
13275 that was so large that it became a float. (Bug#8722)
13276
13277 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13278 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13279 Use XFASTINT rather than XUINT when numbers are nonnegative.
13280 (xd_append_arg, Fdbus_method_return_internal):
13281 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13282 arguments, check that Lisp number is nonnegative, rather than
13283 silently wrapping negative numbers around. (Bug#8722)
13284 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13285 (Bug#8722)
13286
13287 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13288
13289 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13290
13291 ccl: Add integer overflow checks.
13292 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13293 (IN_INT_RANGE): New macros.
13294 (ccl_driver): Use them to check for integer overflow when
13295 decoding a CCL program. Many of the new checks are whether XINT (x)
13296 fits in int; it doesn't always, on 64-bit hosts. The new version
13297 doesn't catch all possible integer overflows, but it's an
13298 improvement. (Bug#8719)
13299
13300 * alloc.c (make_event_array): Use XINT, not XUINT.
13301 There's no need for unsigned here.
13302
13303 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13304 This follows up to the 2011-05-06 change that substituted uintptr_t
13305 for EMACS_INT. This case wasn't caught back then.
13306
13307 Rework Fformat to avoid integer overflow issues.
13308 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13309 now (part of C89). Include <verify.h>.
13310 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13311 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13312 (Fformat): Avoid the prepass trying to compute sizes; it was only
13313 approximate and thus did not catch overflow reliably. Instead, walk
13314 through the format just once, formatting and computing sizes as we go,
13315 checking for integer overflow at every step, and allocating a larger
13316 buffer as needed. Keep track separately whether the format is
13317 multibyte. Keep only the most-recently calculated precision, rather
13318 than them all. Record whether each argument has been converted to
13319 string. Use EMACS_INT, not int, for byte and char and arg counts.
13320 Support field widths and precisions larger than INT_MAX. Avoid
13321 sprintf's undefined behavior with conversion specifications such as %#d
13322 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13323 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13324 formatting out-of-range floating point numbers with int
13325 formats. (Bug#8668)
13326
13327 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13328
13329 * data.c: Avoid integer truncation in expressions involving floats.
13330 * data.c: Include <intprops.h>.
13331 (arith_driver): When there's an integer overflow in an expression
13332 involving floating point, convert the integers to floating point
13333 so that the resulting value does not suffer from catastrophic
13334 integer truncation. For example, on a 64-bit host (* 4
13335 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13336 Do not rely on undefined behavior after integer overflow.
13337
13338 merge count_size_as_multibyte, parse_str_to_multibyte
13339 * character.c, character.h (count_size_as_multibyte):
13340 Rename from parse_str_to_multibyte; all uses changed.
13341 Check for integer overflow.
13342 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13343 since it's now a duplicate of the other. This is more of
13344 a character than a buffer op, so better that it's in character.c.
13345 * fns.c, print.c: Adjust to above changes.
13346
13347 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13348
13349 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13350
13351 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13352
13353 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13354 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13355 (x_clipboard_manager_save): Now static.
13356 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13357
13358 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13359 (crypto_hash_function): Now static.
13360 Fix pointer signedness problems. Avoid unnecessary initializations.
13361
13362 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13363
13364 * termhooks.h (Vselection_alist): Make it terminal-local.
13365
13366 * terminal.c (create_terminal): Initialize it.
13367
13368 * xselect.c: Support for clipboard managers.
13369 (Vselection_alist): Move to termhooks.h as terminal-local var.
13370 (LOCAL_SELECTION): New macro.
13371 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13372 (symbol_to_x_atom): Remove gratuitous arg.
13373 (x_handle_selection_request, lisp_data_to_selection_data)
13374 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13375 (x_own_selection, x_get_local_selection, x_convert_selection):
13376 New arg, specifying work frame. Use terminal-local Vselection_alist.
13377 (some_frame_on_display): Delete unused function.
13378 (Fx_own_selection_internal, Fx_get_selection_internal)
13379 (Fx_disown_selection_internal, Fx_selection_owner_p)
13380 (Fx_selection_exists_p): New optional frame arg.
13381 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13382 (x_handle_selection_clear): Don't treat other terminals with the
13383 same keyboard specially. Use the terminal-local Vselection_alist.
13384 (x_clear_frame_selections): Use Frun_hook_with_args.
13385
13386 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13387
13388 * xterm.h: Add support for those atoms.
13389
13390 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
13391
13392 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13393 (converted_selections, conversion_fail_tag): New global variables.
13394 (x_selection_request_lisp_error): Free the above.
13395 (x_get_local_selection): Remove unnecessary code.
13396 (x_reply_selection_request): Args changed; handle arbitrary array
13397 of converted selections stored in converted_selections.
13398 Separate the XChangeProperty and SelectionNotify steps.
13399 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13400 (x_convert_selection): New function.
13401 (x_handle_selection_event): Simplify.
13402 (x_get_foreign_selection): Don't ignore incoming requests while
13403 waiting for an answer; this will fail when we implement
13404 SAVE_TARGETS, and seems unnecessary anyway.
13405 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13406 (Vx_sent_selection_functions): Doc fix.
13407
13408 2011-05-26 Leo Liu <sdl.web@gmail.com>
13409
13410 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13411
13412 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13413
13414 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13415
13416 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13417 for fringe update if it has periodic bitmap.
13418 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
13419 and fringe_bitmap_periodic_p.
13420
13421 * fringe.c (get_fringe_bitmap_data): New function.
13422 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13423 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13424 row. Mark glyph row for fringe update if periodicity changed.
13425
13426 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13427 for fringe update unless it has periodic bitmap.
13428
13429 2011-05-25 Kenichi Handa <handa@m17n.org>
13430
13431 * xdisp.c (get_next_display_element): Set correct it->face_id for
13432 a static composition.
13433
13434 2011-05-24 Leo Liu <sdl.web@gmail.com>
13435
13436 * deps.mk (fns.o):
13437 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13438
13439 * fns.c (crypto_hash_function, Fsha1): New function.
13440 (Fmd5): Use crypto_hash_function.
13441 (syms_of_fns): Add Ssha1.
13442
13443 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13444
13445 * gnutls.c: Remove unused macros.
13446 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13447 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13448 Remove macros that are defined and never used.
13449 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13450
13451 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13452
13453 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13454 (Fx_get_selection_internal): Minor cleanup.
13455 (Fx_own_selection_internal): Rename arguments for consistency with
13456 select.el.
13457
13458 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13459
13460 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13461
13462 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13463
13464 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13465
13466 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13467
13468 * dispnew.c (scrolling_window): Don't exclude the case that the
13469 last enabled row in the desired matrix touches the bottom boundary.
13470
13471 2011-05-21 Glenn Morris <rgm@gnu.org>
13472
13473 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
13474 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13475 and add some more files.
13476
13477 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13478
13479 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13480 report_file_error introduced by the change from 2011-05-07.
13481
13482 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13483
13484 * systime.h (Time): Define only if emacs is defined.
13485 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13486 where the include path doesn't have X11/X.h by default. See
13487 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13488
13489 2011-05-20 Kenichi Handa <handa@m17n.org>
13490
13491 * composite.c (find_automatic_composition): Fix previous change.
13492
13493 2011-05-20 Glenn Morris <rgm@gnu.org>
13494
13495 * lisp.mk: New file, split from Makefile.in.
13496 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13497 (shortlisp): Remove.
13498 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13499
13500 2011-05-19 Glenn Morris <rgm@gnu.org>
13501
13502 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13503 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13504 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13505 (lisp): Set the order to that of loadup.el.
13506 (shortlisp): Make it a copy of $lisp.
13507 (SOME_MACHINE_LISP): Remove.
13508 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13509 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13510
13511 2011-05-18 Kenichi Handa <handa@m17n.org>
13512
13513 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13514 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13515 (find_automatic_composition): Mostly rewrite for efficiency.
13516
13517 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
13518
13519 * makefile.w32-in: Update dependencies.
13520
13521 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13522
13523 * menu.c: Include limits.h (fixes the MS-Windows build broken by
13524 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
13525
13526 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
13527
13528 Fix some integer overflow issues, such as string length overflow.
13529
13530 * insdel.c (count_size_as_multibyte): Check for string overflow.
13531
13532 * character.c (lisp_string_width): Check for string overflow.
13533 Use EMACS_INT, not int, for string indexes and lengths; in
13534 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13535 the resulting string length overflows an EMACS_INT; instead,
13536 report a string overflow if no precision given. When checking for
13537 precision exhaustion, use a check that cannot possibly have
13538 integer overflow. (Bug#8675)
13539 * character.h (lisp_string_width): Adjust to new signature.
13540
13541 * alloc.c (string_overflow): New function.
13542 (Fmake_string): Use it. This doesn't change behavior, but saves
13543 a few bytes and will simplify future changes.
13544 * character.c (string_escape_byte8): Likewise.
13545 * lisp.h (string_overflow): New decl.
13546
13547 Fixups, following up to the user-interface timestamp change.
13548 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13549 for UI timestamps, instead of unsigned long.
13550 * msdos.c (mouse_get_pos): Likewise.
13551 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
13552 * w32gui.h (Time): Define by including "systime.h" rather than by
13553 declaring it ourselves. (Bug#8664)
13554
13555 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13556 * image.c (clear_image_cache): Likewise.
13557
13558 * term.c (term_mouse_position): Don't assume time_t wraparound.
13559
13560 Be more systematic about user-interface timestamps.
13561 Before, the code sometimes used 'Time', sometimes 'unsigned long',
13562 and sometimes 'EMACS_UINT', to represent these timestamps.
13563 This change causes it to use 'Time' uniformly, as that's what X uses.
13564 This makes the code easier to follow, and makes it easier to catch
13565 integer overflow bugs such as Bug#8664.
13566 * frame.c (Fmouse_position, Fmouse_pixel_position):
13567 Use Time, not unsigned long, for user-interface timestamps.
13568 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13569 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13570 * keyboard.h (last_event_timestamp): Likewise.
13571 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13572 * menu.h (xmenu_show): Likewise.
13573 * term.c (term_mouse_position): Likewise.
13574 * termhooks.h (struct input_event.timestamp): Likewise.
13575 (struct terminal.mouse_position_hook): Likewise.
13576 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13577 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13578 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13579 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13580 what it was before.
13581 * menu.h, termhooks.h: Include "systime.h", for Time.
13582
13583 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13584 Don't assume that the difference between two unsigned long values
13585 can fit into an integer. At this point, we know button_down_time
13586 <= event->timestamp, so the difference must be nonnegative, so
13587 there's no need to cast the result if double-click-time is
13588 nonnegative, as it should be; check that it's nonnegative, just in
13589 case. This bug is triggered when events are more than 2**31 ms
13590 apart (about 25 days). (Bug#8664)
13591
13592 * xselect.c (last_event_timestamp): Remove duplicate decl.
13593 (x_own_selection): Remove needless cast to unsigned long.
13594
13595 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13596 that always fit in int. Use a sentinel instead of a counter, to
13597 avoid a temp and to allay GCC's concerns about possible int overflow.
13598 * frame.h (struct frame): Use int for menu_bar_items_used
13599 instead of EMACS_INT, since it always fits in int.
13600
13601 * menu.c (grow_menu_items): Check for int overflow.
13602
13603 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13604
13605 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13606 Before, the code was not consistent. These values cannot exceed
13607 2**31 - 1 so there's no need to make them unsigned.
13608 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13609 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13610 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13611 as modifiers.
13612 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13613
13614 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13615 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13616 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13617 presumably because the widths might not match.
13618
13619 * window.c (size_window): Avoid needless test at loop start.
13620
13621 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13622
13623 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13624
13625 2011-05-12 Drew Adams <drew.adams@oracle.com>
13626
13627 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13628
13629 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13630
13631 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13632 `width' to `bar_area_x' and `bar_area_width', respectively.
13633 (x_scroll_run): Take account of fringe background extension.
13634
13635 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13636 Rename local vars `left' and `width' to `bar_area_x' and
13637 `bar_area_width', respectively.
13638 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13639 background extension.
13640
13641 2011-05-10 Jim Meyering <meyering@redhat.com>
13642
13643 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13644
13645 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
13646
13647 * image.c (Finit_image_library): Return t for built-in image types,
13648 like pbm and xbm. (Bug#8640)
13649
13650 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13651
13652 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13653
13654 2011-05-07 Eli Zaretskii <eliz@gnu.org>
13655
13656 * w32console.c (Fset_screen_color): Doc fix.
13657 (Fget_screen_color): New function.
13658 (syms_of_ntterm): Defsubr it.
13659
13660 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13661 unlink the temporary file if Fcall_process didn't create it in the
13662 first place.
13663 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13664 child process will be redirected to a file specified with `:file'.
13665 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13666 cue to call_process_cleanup not to close that handle.
13667
13668 2011-05-07 Ben Key <bkey76@gmail.com>
13669
13670 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13671 one of two shell specific rules, either bootstrap-temacs-CMD or
13672 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13673 to the previous implementation of the bootstrap-temacs rule.
13674 The bootstrap-temacs-CMD rule is similar to the previous
13675 implementation of the bootstrap-temacs rule except that it
13676 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13677 variable.
13678
13679 These changes, along with some changes to nt/configure.bat,
13680 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13681 earlier fix to add support for --cflags and --ldflags options
13682 that include quotes so that it works whether make uses cmd or
13683 sh as the shell.
13684
13685 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
13686
13687 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13688 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13689 is a constant.
13690 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13691 a string. Handle both cases.
13692 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13693 (Fdbus_register_method): Use Qinvalid_function.
13694
13695 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13696
13697 * makefile.w32-in: Update dependencies.
13698 (LISP_H): Add inttypes.h and stdin.h.
13699 (PROCESS_H): Add unistd.h.
13700
13701 2011-05-06 Eli Zaretskii <eliz@gnu.org>
13702
13703 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13704 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13705
13706 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
13707
13708 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13709
13710 * term.c (vfatal): Remove stray call to va_end.
13711 It's not needed and the C Standard doesn't allow it here anyway.
13712
13713 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13714 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13715
13716 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13717 bytes.
13718
13719 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13720
13721 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13722
13723 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13724
13725 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13726
13727 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13728
13729 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13730 * charset.c (Fdefine_charset_internal): Don't initialize
13731 charset.code_space[15]. The value was garbage, on hosts with
13732 32-bit int (Bug#8600).
13733
13734 * lread.c (read_integer): Be more consistent with string-to-number.
13735 Use string_to_number to do the actual conversion; this avoids
13736 rounding errors and fixes some other screwups. Without this fix,
13737 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13738 (digit_to_number): Move earlier, for benefit of read_integer.
13739 Return -1 if the digit is out of range for the base, -2 if it is
13740 not a digit in any supported base. (Bug#8602)
13741
13742 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13743
13744 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13745 to match comment at start of function. This also removes a
13746 GCC warning about overflow in a 32+64-bit port.
13747
13748 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13749
13750 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13751 Reported by Stefan Monnier in
13752 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
13753 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13754 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
13755
13756 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13757 (EMACS_UINTPTR): Likewise, with uintptr_t.
13758
13759 * lisp.h: Prefer 64-bit EMACS_INT if available.
13760 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13761 on 32-bit hosts that have 64-bit int, so that they can access
13762 large files.
13763 However, temporarily disable this change unless the temporary
13764 symbol WIDE_EMACS_INT is defined.
13765
13766 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13767
13768 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13769 This removes an assumption that EMACS_INT and long are the same
13770 width as pointers. The assumption is true for Emacs porting targets
13771 now, but we want to make other targets possible.
13772 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13773 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13774 In the rest of the code, change types of integers that hold casted
13775 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13776 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13777 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13778 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13779 No need to cast type when ORing.
13780 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13781 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13782 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13783 assume EMACS_INT is the same width as char *.
13784 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13785 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13786 Remove no-longer-needed casts.
13787 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13788 (xg_tool_bar_help_callback, xg_make_tool_item):
13789 Use EMACS_INTPTR to hold an integer
13790 that will be cast to void *; this can avoid a GCC warning
13791 if EMACS_INT is not the same width as void *.
13792 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13793 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13794 (current_message_1, set_message_1):
13795 Use a local to convert to proper width without a cast.
13796 * xmenu.c (dialog_selection_callback): Likewise.
13797
13798 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13799 Also, don't assume VALBITS / RAND_BITS is less than 5,
13800 and don't rely on undefined behavior when shifting a 1 left into
13801 the sign bit.
13802 * lisp.h (get_random): Change signature to match.
13803
13804 * lread.c (hash_string): Use size_t, not int, for hash computation.
13805 Normally we prefer signed values; but hashing is special, because
13806 it's better to use unsigned division on hash table sizes so that
13807 the remainder is nonnegative. Also, size_t is the natural width
13808 for hashing into memory. The previous code used 'int', which doesn't
13809 retain enough info to hash well into very large tables.
13810 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13811
13812 * dbusbind.c: Don't possibly lose pointer info when converting.
13813 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13814 Use XPNTR rather than XHASH, so that the high-order bits of
13815 the pointer aren't lost when converting through void *.
13816
13817 * eval.c (Fautoload): Don't double-shift a pointer.
13818
13819 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13820
13821 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13822
13823 * gnutls.c (DEF_GNUTLS_FN):
13824 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13825
13826 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13827
13828 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13829 marker. (Bug#8610)
13830
13831 2011-05-05 Eli Zaretskii <eliz@gnu.org>
13832
13833 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13834 New version that can reserve upto 2GB of heap space.
13835
13836 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
13837
13838 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13839
13840 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13841
13842 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13843 `gnutls_certificate_set_x509_key_file'.
13844
13845 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
13846
13847 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13848 Update dependencies.
13849
13850 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13851
13852 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13853 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13854 Remove unused parameter `fildes'.
13855 * process.c (read_process_output, send_process): Don't pass it.
13856
13857 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13858
13859 Fix previous change: the library cache is defined in w32.c.
13860 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13861 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13862
13863 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13864
13865 Implement dynamic loading of GnuTLS on Windows.
13866
13867 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13868 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13869 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13870 Declare.
13871
13872 * gnutls.c (Qgnutls_dll): Define.
13873 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13874 (gnutls_*): Declare function pointers.
13875 (init_gnutls_functions): New function to initialize function pointers.
13876 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13877 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13878 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13879 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13880 (emacs_gnutls_write, emacs_gnutls_read)
13881 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13882 (Fgnutls_available_p): New function.
13883 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13884 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13885 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13886
13887 * image.c: Include w32.h.
13888 (Vimage_type_cache): Delete.
13889 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13890 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13891 (w32_delayed_load): Move to w32.c.
13892
13893 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13894
13895 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13896 (w32_delayed_load): Move from image.c. When loading a library, record
13897 its filename in the :loaded-from property of the library id.
13898 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13899 Initialize and staticpro them.
13900 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13901
13902 * process.c: Include lisp.h before w32.h, not after.
13903 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13904 instead of gnutls_record_check_pending.
13905
13906 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13907
13908 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13909
13910 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13911 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13912 as passed in.
13913
13914 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13915
13916 * xterm.c (x_set_frame_alpha): Do not set property on anything
13917 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13918
13919 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13920
13921 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13922
13923 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13924
13925 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13926 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13927 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13928 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13929 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13930 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13931 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13932 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13933 (Qgnutls_bootprop_callbacks_verify): Make static.
13934
13935 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13936
13937 * callproc.c: Indentation fixup.
13938
13939 * sysdep.c (wait_for_termination_1): Make static.
13940 (wait_for_termination, interruptible_wait_for_termination):
13941 Move after wait_for_termination_1.
13942
13943 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13944
13945 * sysdep.c (interruptible_wait_for_termination): New function
13946 which is like wait_for_termination, but allows keyboard
13947 interruptions.
13948
13949 * callproc.c (Fcall_process): Add (:file "file") as an option for
13950 the STDOUT buffer.
13951 (Fcall_process_region): Ditto.
13952
13953 2011-04-30 Eli Zaretskii <eliz@gnu.org>
13954
13955 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13956 rather than `XVECTOR (FOO)->size'.
13957
13958 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13959 inttypes.h, as a gnulib replacement is used if it not available in
13960 system headers.
13961
13962 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13963
13964 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13965 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13966 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13967
13968 * coding.c (coding_alloc_by_realloc): Error out if destination
13969 will grow beyond MOST_POSITIVE_FIXNUM.
13970 (decode_coding_emacs_mule): Abort if there isn't enough place in
13971 charbuf for the composition carryover bytes. Reserve an extra
13972 space for up to 2 characters produced in a loop.
13973 (decode_coding_iso_2022): Abort if there isn't enough place in
13974 charbuf for the composition carryover bytes.
13975
13976 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13977
13978 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13979 aborting when %lld or %lll format is passed.
13980 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13981 %llo or %llx format is passed. (Bug#8545)
13982
13983 * window.c (window_scroll_line_based): Use a marker instead of
13984 simple variables to record original value of point. (Bug#7952)
13985
13986 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13987 produced by %s or %c overflows available buffer space. (Bug#8545)
13988
13989 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13990
13991 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
13992 (SIZE_MAX): Move defn after all includes, as they might #define it.
13993
13994 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13995
13996 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13997
13998 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13999
14000 * keyboard.c (Qdelayed_warnings_hook): Define.
14001 (command_loop_1): Run `delayed-warnings-hook'
14002 if Vdelayed_warnings_list is non-nil.
14003 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14004 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14005
14006 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14007
14008 * doprnt.c (doprnt): Don't return value smaller than the buffer
14009 size if the message was truncated. (Bug#8545).
14010
14011 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14012
14013 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14014 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14015
14016 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14017
14018 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14019
14020 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14021
14022 * makefile.w32-in: Update dependencies.
14023
14024 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14025
14026 Improve `doprnt' and its usage. (Bug#8545)
14027 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14028 `format_end'. Remove support for %l as a conversion specifier.
14029 Don't use xrealloc. Improve diagnostics when the %l size modifier
14030 is used. Update the commentary.
14031
14032 * eval.c (verror): Simplify calculation of size_t.
14033
14034 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14035 messages.
14036
14037 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14038
14039 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14040 change.
14041
14042 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14043
14044 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14045 This makes this file independent of the recent pseudovector change.
14046
14047 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14048
14049 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14050
14051 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14052 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14053 Remove unused local.
14054 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14055
14056 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14057 GCC 4.6.0 optimizes based on type-based alias analysis.
14058 For example, if b is of type struct buffer * and v of type struct
14059 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14060 != &v->size, and therefore "v->size = 1; b->size = 2; return
14061 v->size;" must therefore return 1. This assumption is incorrect
14062 for Emacs, since it type-puns struct Lisp_Vector * with many other
14063 types. To fix this problem, this patch adds a new type struct
14064 vectorlike_header that documents the constraints on layout of vectors
14065 and pseudovectors, and helps optimizing compilers not get fooled
14066 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14067 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14068 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14069 the size member.
14070 (XSETPVECTYPE): Rewrite in terms of new macro.
14071 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14072 This is a bit clearer, and further avoids the possibility of
14073 undesirable aliasing.
14074 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14075 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14076 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14077 since Lisp_Subr is a special case (no "next" field).
14078 (ASIZE): Now uses header.size rather than size.
14079 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14080 to avoid the hassle of writing XVECTOR (foo)->header.size.
14081 (struct vectorlike_header): New type.
14082 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14083 object, to help avoid aliasing.
14084 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14085 (SUBRP): Likewise, since Lisp_Subr is a special case.
14086 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14087 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14088 (struct Lisp_Hash_Table): Combine first two members into a single
14089 struct vectorlike_header member. All uses of "size" and "next" members
14090 changed to be "header.size" and "header.next".
14091 * buffer.h (struct buffer): Likewise.
14092 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14093 * frame.h (struct frame): Likewise.
14094 * process.h (struct Lisp_Process): Likewise.
14095 * termhooks.h (struct terminal): Likewise.
14096 * window.c (struct save_window_data, struct saved_window): Likewise.
14097 * window.h (struct window): Likewise.
14098 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14099 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14100 * buffer.c (init_buffer_once): Likewise.
14101 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14102 special case.
14103 * process.c (Fformat_network_address): Use local var for size,
14104 for brevity.
14105
14106 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14107
14108 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14109 * data.c (atof): Remove decl; no longer used or needed.
14110 (digit_to_number): Move to lread.c.
14111 (Fstring_to_number): Use new string_to_number function, to be
14112 consistent with how the Lisp reader treats infinities and NaNs.
14113 Do not assume that floating-point numbers represent EMACS_INT
14114 without losing information; this is not true on most 64-bit hosts.
14115 Avoid double-rounding errors, by insisting on integers when
14116 parsing non-base-10 numbers, as the documentation specifies.
14117 * lisp.h (string_to_number): New decl, replacing ...
14118 (isfloat_string): Remove.
14119 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14120 (read1): Do not accept +. and -. as integers; this
14121 appears to have been a coding error. Similarly, do not accept
14122 strings like +-1e0 as floating point numbers. Do not report
14123 overflow for integer overflows unless the base is not 10 which
14124 means we have no simple and reliable way to continue.
14125 Break out the floating-point parsing into a new
14126 function string_to_number, so that Fstring_to_number parses
14127 floating point numbers consistently with the Lisp reader.
14128 (digit_to_number): Move here from data.c. Make it static inline.
14129 (E_CHAR, EXP_INT): Remove, replacing with ...
14130 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14131 (string_to_number): New function, replacing isfloat_string.
14132 This function checks for valid syntax and produces the resulting
14133 Lisp float number too. Rework it so that string-to-number
14134 no longer mishandles examples like "1.0e+". Use strtoumax,
14135 so that overflow for non-base-10 numbers is reported only when
14136 there's no portable and simple way to convert to floating point.
14137
14138 * textprop.c (set_text_properties_1): Rewrite for clarity,
14139 and to avoid GCC warning about integer overflow.
14140
14141 * intervals.h (struct interval): Use EMACS_INT for members
14142 where EMACS_UINT might cause problems. See
14143 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14144 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14145 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14146 All uses changed.
14147 (offset_intervals): Tell GCC not to worry about length overflow
14148 when negating a negative length.
14149
14150 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14151 (overrun_check_free): Likewise.
14152
14153 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14154 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14155 word size.
14156
14157 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14158 (gnutls_make_error): Rename local to avoid shadowing.
14159 (gnutls_emacs_global_deinit): ifdef out; not used.
14160 (Fgnutls_boot): Use const for pointer to readonly storage.
14161 Comment out unused local. Fix pointer signedness problems.
14162
14163 * lread.c (openp): Don't stuff size_t into an 'int'.
14164 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14165 about possible signed overflow.
14166
14167 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14168 (GDK_KEY_g): Don't define if already defined.
14169 (xg_prepare_tooltip): Avoid pointer signedness problem.
14170 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14171
14172 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14173 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14174
14175 * xfns.c (Fx_window_property): Simplify a bit,
14176 to make a bit faster and to avoid GCC 4.6.0 warning.
14177 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14178
14179 * fns.c (internal_equal): Don't assume size_t fits in int.
14180
14181 * alloc.c (compact_small_strings): Tighten assertion a little.
14182
14183 Replace pEd with more-general pI, and fix some printf arg casts.
14184 * lisp.h (pI): New macro, generalizing old pEd macro to other
14185 conversion specifiers. For example, use "...%"pI"d..." rather
14186 than "...%"pEd"...".
14187 (pEd): Remove. All uses replaced with similar uses of pI.
14188 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14189 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14190 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14191 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14192 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14193 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14194 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14195 64-bit hosts.
14196 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14197 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14198 * print.c (safe_debug_print, print_object): Likewise.
14199 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14200 to int.
14201 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14202 avoiding the 0 flag, which is not portable.
14203 * process.c (Fmake_network_process): Use pI to avoid cast.
14204 * region-cache.c (pp_cache): Likewise.
14205 * xdisp.c (decode_mode_spec): Likewise.
14206 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14207 behavior on 64-bit hosts with printf arg.
14208 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14209 (x_stop_queuing_selection_requests): Likewise.
14210 (x_get_window_property): Don't truncate byte count to an 'int'
14211 when tracing.
14212
14213 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14214 here, since it parses constructs like leading '-' and spaces,
14215 which are not wanted; and it overflows with large numbers.
14216 Instead, simply match F[0-9]+, which is what is wanted anyway.
14217
14218 * alloc.c: Remove unportable assumptions about struct layout.
14219 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14220 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14221 (allocate_vectorlike, make_pure_vector): Use the new macros,
14222 plus offsetof, to remove unportable assumptions about struct layout.
14223 These assumptions hold on all porting targets that I know of, but
14224 they are not guaranteed, they're easy to remove, and removing them
14225 makes further changes easier.
14226
14227 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14228 This doesn't fix a bug but makes the code clearer.
14229 (string_overrun_cookie): Now const. Use initializers that
14230 don't formally overflow signed char, to avoid warnings.
14231 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14232 can cause Emacs to crash when string overrun checking is enabled.
14233 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14234 multiple of sizeof (EMACS_INT); it need not be, if
14235 alignof(EMACS_INT) < sizeof (EMACS_INT).
14236 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14237
14238 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14239
14240 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14241
14242 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14243
14244 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14245 supposed to be handshaking. (Bug#8556)
14246 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14247
14248 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14249
14250 * lisp.h (Qdebug): List symbol.
14251 * eval.c (Qdebug): Restore global linkage.
14252 * keyboard.c (debug-on-event): New variable.
14253 (handle_user_signal): Break into debugger when debug-on-event
14254 matches the current signal symbol.
14255
14256 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14257
14258 * alloc.c (check_sblock, check_string_bytes)
14259 (check_string_free_list): Convert to standard C.
14260
14261 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14262
14263 * w32.c (emacs_gnutls_push): Fix typo.
14264
14265 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14266
14267 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14268 "cast to pointer from integer of different size".
14269
14270 Improve doprnt and its use in verror. (Bug#8545)
14271 * doprnt.c (doprnt): Document the set of format control sequences
14272 supported by the function. Use SAFE_ALLOCA instead of always
14273 using `alloca'.
14274
14275 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14276 is one byte too soon. Don't use xrealloc; instead xfree and
14277 xmalloc anew.
14278
14279 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14280
14281 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14282 callbacks stage.
14283
14284 * gnutls.c: Renamed global_initialized to
14285 gnutls_global_initialized. Added internals for the
14286 :verify-hostname-error, :verify-error, and :verify-flags
14287 parameters of `gnutls-boot' and documented those parameters in the
14288 docstring. Start callback support.
14289 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14290 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14291 on error. Return error code.
14292 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14293 (emacs_gnutls_read): Likewise.
14294 (Fgnutls_boot): Return handshake error code.
14295 (emacs_gnutls_handle_error): New function.
14296 (wsaerror_to_errno): Likewise.
14297
14298 * w32.h (emacs_gnutls_pull): Add prototype.
14299 (emacs_gnutls_push): Likewise.
14300
14301 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14302 (emacs_gnutls_push): Likewise.
14303
14304 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14305
14306 * process.c (wait_reading_process_output): Check if GnuTLS
14307 buffered some data internally if no FDs are set for TLS
14308 connections.
14309
14310 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14311 (LIBS): Link to USER_LIBS.
14312 ($(BLD)/gnutls.$(0)): New target.
14313
14314 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14315
14316 * xdisp.c (handle_single_display_spec): Rename the
14317 display_replaced_before_p argument into display_replaced_p, to
14318 make it consistent with the commentary. Fix typos in the
14319 commentary.
14320
14321 * textprop.c (syms_of_textprop): Remove dead code.
14322 (copy_text_properties): Delete obsolete commentary about an
14323 interface that was deleted long ago. Fix typos in the description
14324 of arguments.
14325
14326 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14327 to changes in oldXMenu/XMenu.h from 2011-04-16.
14328 <menu_help_message, prev_menu_help_message>: Constify.
14329 (IT_menu_make_room): menu->help_text is now `const char **';
14330 adjust.
14331
14332 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14333 to changes in oldXMenu/XMenu.h from 2011-04-16.
14334 (struct XMenu): Declare `help_text' `const char **'.
14335
14336 * xfaces.c <Qunspecified>: Make extern again.
14337
14338 * syntax.c: Include sys/types.h before including regex.h, as
14339 required by POSIX.
14340
14341 * doc.c (get_doc_string): Improve the format passed to `error'.
14342
14343 * doprnt.c (doprnt): Improve commentary.
14344
14345 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14346
14347 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14348 them with etags.
14349
14350 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14351 changes in globals.h immediately force recompilation.
14352 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14353 $(CURDIR)/s/ms-w32.h.
14354 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
14355
14356 * character.c (Fchar_direction): Function deleted.
14357 (syms_of_character): Don't defsubr it.
14358 <char-direction-table>: Deleted.
14359
14360 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14361
14362 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14363 * doprnt.c: Include limits.h.
14364 (SIZE_MAX): New macro.
14365 (doprnt): Return a size_t value. 2nd arg is now size_t.
14366 Many local variables are now size_t instead of int or unsigned.
14367 Improve overflow protection. Support `l' modifier for integer
14368 conversions. Support %l conversion. Don't assume an EMACS_INT
14369 argument for integer conversions and for %c.
14370
14371 * lisp.h (doprnt): Restore prototype.
14372
14373 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14374 $(SRC)/character.h.
14375
14376 * Makefile.in (base_obj): Add back doprnt.o.
14377
14378 * deps.mk (doprnt.o): Add back prerequisites.
14379 (callint.o): Depend on character.h.
14380
14381 * eval.c (internal_lisp_condition_case): Include the handler
14382 representation in the error message.
14383 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14384 when breaking from the loop.
14385
14386 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14387
14388 * callint.c (Fcall_interactively): When displaying error message
14389 about invalid control letter, pass the character's codepoint, not
14390 a pointer to its multibyte form. Improve display of the character
14391 in octal and display also its hex code.
14392
14393 * character.c (char_string): Use %x to display the (unsigned)
14394 codepoint of an invalid character, to avoid displaying a bogus
14395 negative value.
14396
14397 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14398 `error', not SYMBOL_NAME itself.
14399
14400 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14401 character arguments to `error'.
14402
14403 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14404 to `error' in error message about FINAL_CHAR argument. Make sure
14405 FINAL_CHAR is a character, and use %c when it is passed as
14406 argument to `error'.
14407
14408 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14409
14410 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14411
14412 * w32.c: Include <time.h>.
14413 (sys_localtime): New function.
14414
14415 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
14416
14417 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14418
14419 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14420
14421 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
14422
14423 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14424 zombies (Bug#8467).
14425
14426 2011-04-19 Eli Zaretskii <eliz@gnu.org>
14427
14428 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14429 gl_state.e_property when gl_state.object is Qt.
14430
14431 * insdel.c (make_gap_larger): Remove limitation of buffer size
14432 to <= INT_MAX.
14433
14434 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
14435
14436 * xdisp.c (lookup_glyphless_char_display)
14437 (produce_glyphless_glyph): Handle cons cell entry in
14438 glyphless-char-display.
14439 (Vglyphless_char_display): Document it.
14440
14441 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14442 glyphless-char-display.
14443
14444 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
14445
14446 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14447
14448 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14449
14450 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14451 definition for no-X builds.
14452
14453 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
14454
14455 Static checks with GCC 4.6.0 and non-default toolkits.
14456
14457 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14458
14459 * process.c (keyboard_bit_set): Define only if SIGIO.
14460 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14461 (send_process): Repair possible setjmp clobbering.
14462
14463 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14464
14465 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14466
14467 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14468
14469 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14470 Define only if needed.
14471
14472 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14473 by pacifying GCC about it. Maybe it's time to retire it?
14474 * xfaces.c (USG, __TIMEVAL__): Likewise.
14475
14476 * dispextern.h (struct redisplay_interface): Rename param
14477 to avoid shadowing.
14478 * termhooks.h (struct terminal): Likewise.
14479 * xterm.c (xembed_send_message): Likewise.
14480
14481 * insdel.c (make_gap_smaller): Define only if
14482 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14483
14484 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14485 it.
14486
14487 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14488 so that we aren't warned about unused symbols.
14489
14490 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14491
14492 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14493
14494 * xfns.c (x_real_positions): Mark locals as initialized.
14495
14496 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14497
14498 * xterm.c: Fix problems found by static analysis with other toolkits.
14499 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
14500 (x_dispatch_event): Declare static if USE_GTK, and
14501 define if USE_GTK || USE_X_TOOLKIT.
14502 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
14503 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
14504 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14505 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
14506
14507 * xmenu.c (menu_help_callback): Pointer type fixes.
14508 Use const pointers when pointing at readonly data. Avoid pointer
14509 signedness clashes.
14510 (FALSE): Remove unused macro.
14511 (update_frame_menubar): Remove unused decl.
14512
14513 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14514
14515 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14516 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14517 (single_menu_item): Rename local to avoid shadowing.
14518
14519 * keyboard.c (make_lispy_event): Remove unused local var.
14520
14521 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14522 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14523
14524 * bitmaps: Change bitmaps from unsigned char back to the X11
14525 compatible char. Avoid the old compiler warnings about
14526 out-of-range initializers by using, for example, '\xab' rather
14527 than 0xab.
14528
14529 * xgselect.c (xgselect_initialize): Check vs interface
14530 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14531
14532 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14533
14534 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14535 to read-only memory.
14536
14537 * fns.c (vector): Remove; this old hack is no longer needed.
14538
14539 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
14540 Remove unused var.
14541 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
14542
14543 * xrdb.c (x_load_resources): Omit unused local.
14544
14545 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
14546 (x_window): Rename locals to avoid shadowing.
14547 (USG): Use the kludged USG macro, to pacify gcc.
14548
14549 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
14550 (x_term_init): Remove local to avoid shadowing.
14551
14552 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
14553
14554 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14555 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14556
14557 2011-04-16 Eli Zaretskii <eliz@gnu.org>
14558
14559 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14560
14561 Fix regex.c, syntax.c and friends for buffers > 2GB.
14562 * syntax.h (struct gl_state_s): Declare character position members
14563 EMACS_INT.
14564
14565 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14566
14567 * textprop.c (verify_interval_modification, interval_of):
14568 Declare arguments EMACS_INT.
14569
14570 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14571 EMACS_INT.
14572
14573 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14574
14575 * indent.c (Fvertical_motion): Local variable it_start is now
14576 EMACS_INT.
14577
14578 * regex.c (re_match, re_match_2, re_match_2_internal)
14579 (bcmp_translate, regcomp, regexec, print_double_string)
14580 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14581 (re_compile_pattern, re_exec): Declare arguments and local
14582 variables `size_t' and `ssize_t' and return values `regoff_t', as
14583 appropriate.
14584 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14585 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14586 <compile_stack_type>: `size' and `avail' are now `size_t'.
14587
14588 * regex.h <regoff_t>: Use ssize_t, not int.
14589 (re_search, re_search_2, re_match, re_match_2): Arguments that
14590 specify buffer/string position and length are now ssize_t and
14591 size_t. Return type is regoff_t.
14592
14593 2011-04-16 Ben Key <bkey76@gmail.com>
14594
14595 * nsfont.m: Fixed bugs in ns_get_family and
14596 ns_descriptor_to_entity that were caused by using free to
14597 deallocate memory blocks that were allocated by xmalloc (via
14598 xstrdup). This caused Emacs to crash when compiled with
14599 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14600 --enable-checking=xmallocoverrun). xfree is now used to
14601 deallocate these memory blocks.
14602
14603 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
14604
14605 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14606
14607 emacs_write: Accept and return EMACS_INT for sizes.
14608 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14609 et seq.
14610 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14611 Accept and return EMACS_INT.
14612 (emacs_gnutls_write): Return the number of bytes written on
14613 partial writes.
14614 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
14615 (emacs_read, emacs_write): Remove check for negative size, as the
14616 Emacs source code has been audited now.
14617 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14618 (emacs_read, emacs_write): Use it.
14619 * process.c (send_process): Adjust to the new signatures of
14620 emacs_write and emacs_gnutls_write. Do not attempt to store
14621 a byte offset into an 'int'; it might overflow.
14622 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
14623
14624 * sound.c: Don't assume sizes fit in 'int'.
14625 (struct sound_device.period_size, alsa_period_size):
14626 Return EMACS_INT, not int.
14627 (struct sound_device.write, vox_write, alsa_write):
14628 Accept EMACS_INT, not int.
14629 (wav_play, au_play): Use EMACS_INT to store sizes and to
14630 record read return values.
14631
14632 2011-04-15 Ben Key <bkey76@gmail.com>
14633
14634 * keyboard.c (Qundefined): Don't declare static since it is used
14635 in nsfns.m.
14636 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14637 static since they are used in nsfont.m.
14638
14639 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14640
14641 * process.c (Qprocessp): Don't declare static.
14642 * lisp.h (Qprocessp): Declare again.
14643
14644 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
14645
14646 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14647
14648 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14649
14650 Improve C-level modularity by making more things 'static'.
14651
14652 Don't publish debugger-only interfaces to other modules.
14653 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14654 (verify_bytepos, count_markers): Move decls to the only modules
14655 that need them.
14656 * region-cache.h (pp_cache): Likewise.
14657 * window.h (check_all_windows): Likewise.
14658 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14659
14660 * sysdep.c (croak): Now static, if
14661 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14662 * syssignal.h (croak): Declare only if not static.
14663
14664 * alloc.c (refill_memory_reserve): Now static if
14665 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14666 * lisp.h (refill_memory_reserve): Declare only if not static.
14667
14668 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14669 Define only if USE_LUCID.
14670
14671 * xrdb.c (x_customization_string, x_rm_string): Now static.
14672
14673 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14674 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14675
14676 * xdisp.c (draw_row_with_mouse_face): Now static.
14677 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14678
14679 * window.h (check_all_windows): Mark externally visible.
14680
14681 * window.c (window_deletion_count): Now static.
14682
14683 * undo.c: Make symbols static if they're not exported.
14684 (last_undo_buffer, last_boundary_position, pending_boundary):
14685 Now static.
14686
14687 * textprop.c (interval_insert_behind_hooks): Now static.
14688 (interval_insert_in_front_hooks): Likewise.
14689
14690 * term.c: Make symbols static if they're not exported.
14691 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14692 (max_frame_lines, tty_set_terminal_modes):
14693 (tty_reset_terminal_modes, tty_turn_off_highlight):
14694 (get_tty_terminal): Now static.
14695 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14696 * termhooks.h (term_mouse_moveto): Do not declare if
14697 HAVE_WINDOW_SYSTEM.
14698 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14699 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14700
14701 * sysdep.c: Make symbols static if they're not exported.
14702 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14703 Now static.
14704 (sigprocmask_set, full_mask): Remove; unused.
14705 (wait_debugging): Mark as visible.
14706 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14707 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14708
14709 * syntax.c (syntax_temp): Define only if !__GNUC__.
14710
14711 * sound.c (current_sound_device, current_sound): Now static.
14712
14713 * search.c (searchbufs, searchbuf_head): Now static.
14714
14715 * scroll.c (scroll_cost): Remove; unused.
14716 * dispextern.h (scroll_cost): Remove decl.
14717
14718 * region-cache.h (pp_cache): Mark as externally visible.
14719
14720 * process.c: Make symbols static if they're not exported.
14721 (process_tick, update_tick, create_process, chan_process):
14722 (Vprocess_alist, proc_buffered_char, datagram_access):
14723 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14724 (deactivate_process): Mark defn as static, as well as decl.
14725 * lisp.h (create_process): Remove decl.
14726 * process.h (chan_process, Vprocess_alist): Remove decls.
14727
14728 * print.c: Make symbols static if they're not exported.
14729 (print_depth, new_backquote_output, being_printed, print_buffer):
14730 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14731 (print_interval, print_number_index, initial_stderr_stream):
14732 Now static.
14733 * lisp.h (Fprinc): Remove decl.
14734 (debug_output_compilation_hack): Mark as externally visible.
14735
14736 * sysdep.c (croak): Move decl from here to syssignal.h.
14737 * syssignal.h (croak): Put it here, so the API can be checked when
14738 'croak' is called from dissociate_if_controlling_tty.
14739
14740 * minibuf.c: Make symbols static if they're not exported.
14741 (minibuf_save_list, choose_minibuf_frame): Now static.
14742 * lisp.h (choose_minibuf_frame): Remove decl.
14743
14744 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14745
14746 * lread.c: Make symbols static if they're not exported.
14747 (read_objects, initial_obarray, oblookup_last_bucket_number):
14748 Now static.
14749 (make_symbol): Remove; unused.
14750 * lisp.h (initial_obarray, make_symbol): Remove decls.
14751
14752 * keyboard.c: Make symbols static if they're not exported.
14753 (single_kboard, recent_keys_index, total_keys, recent_keys):
14754 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14755 (this_single_command_key_start, echoing, last_auto_save):
14756 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14757 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14758 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14759 (Vlispy_mouse_stem, double_click_count):
14760 Now static.
14761 (force_auto_save_soon): Define only if SIGDANGER.
14762 (ignore_mouse_drag_p): Now static if
14763 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14764 (print_help): Remove; unused.
14765 (stop_character, last_timer_event): Mark as externally visible.
14766 * keyboard.h (ignore_mouse_drag_p): Declare only if
14767 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14768 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14769 * lisp.h (echoing): Remove decl.
14770 (force_auto_save_soon): Declare only if SIGDANGER.
14771 * xdisp.c (redisplay_window): Simplify code, to make it more
14772 obvious that ignore_mouse_drag_p is not accessed if !defined
14773 USE_GTK && !defined HAVE_NS.
14774
14775 * intervals.c: Make symbols static if they're not exported.
14776 (merge_properties_sticky, merge_interval_right, delete_interval):
14777 Now static.
14778 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14779
14780 * insdel.c: Make symbols static if they're not exported.
14781 However, leave prepare_to_modify_buffer alone. It's never
14782 called from outside this function, but that appears to be a bug.
14783 (combine_after_change_list, combine_after_change_buffer):
14784 (adjust_after_replace, signal_before_change): Now static.
14785 (adjust_after_replace_noundo): Remove; unused.
14786 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
14787 (signal_before_change): Remove decls.
14788
14789 * indent.c (val_compute_motion, val_vmotion): Now static.
14790
14791 * image.c: Make symbols static if they're not exported.
14792 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14793 if USE_GTK.
14794 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14795 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14796
14797 * fringe.c (standard_bitmaps): Now static.
14798 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14799
14800 * frame.c: Make symbols static if they're not exported.
14801 (x_report_frame_params, make_terminal_frame): Now static.
14802 (get_frame_param): Now static, unless HAVE_NS.
14803 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14804 (x_get_resource_string): Remove; not used.
14805 * frame.h (make_terminal_frame, x_report_frame_params):
14806 (x_get_resource_string); Remove decls.
14807 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14808 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14809
14810 * font.c, fontset.c: Make symbols static if they're not exported.
14811 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14812 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14813 * font.c (font_close_object): Now static.
14814 * font.h (font_close_object): Remove.
14815 * fontset.c (FONTSET_OBJLIST): Remove.
14816 (free_realized_fontset) #if-0 the body, which does nothing.
14817 (face_suitable_for_char_p): #if-0, as it's never called.
14818 * fontset.h (face_suitable_for_char_p): Remove decl.
14819 * xfaces.c (face_at_string_position):
14820 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
14821 since 0 is always ASCII.
14822
14823 * fns.c (weak_hash_tables): Now static.
14824
14825 * fileio.c: Make symbols static if they're not exported.
14826 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14827 (Vwrite_region_annotation_buffers): Now static.
14828
14829 * eval.c: Make symbols static if they're not exported.
14830 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14831 * lisp.h (backtrace_list): Remove decl.
14832
14833 * emacs.c: Make symbols static if they're not exported.
14834 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14835 (fatal_error_code, fatal_error_signal_hook, standard_args):
14836 Now static.
14837 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14838 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14839 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14840 * lisp.h (fatal_error_signal_hook): Remove decl.
14841 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14842
14843 * editfns.c: Move a (normally-unused) function to its only use.
14844 * editfns.c, lisp.h (get_operating_system_release): Remove.
14845 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14846 worth the hassle of breaking this out.
14847
14848 * xterm.c: Make symbols static if they're not exported.
14849 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14850 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14851 (x_destroy_window, x_delete_display):
14852 Now static.
14853 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14854 (x_mouse_leave): Remove; unused.
14855 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14856 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14857 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14858 Remove decls.
14859 (x_mouse_leave): Declare only if WINDOWSNT.
14860 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14861 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14862 USE_X_TOOLKIT.
14863
14864 * ftxfont.c: Make symbols static if they're not exported.
14865 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14866 HAVE_FREETYPE.
14867 * font.h (ftxfont_driver): Likewise.
14868
14869 * xfns.c: Make symbols static if they're not exported.
14870 (x_last_font_name, x_display_info_for_name):
14871 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14872 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14873 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14874 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14875 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14876 (last_show_tip_args): Now static.
14877 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14878 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14879 (x_screen_planes): Remove; unused.
14880 * dispextern.h (x_screen_planes): Remove decl.
14881
14882 * dispnew.c: Make symbols static if they're not exported.
14883 * dispextern.h (redraw_garbaged_frames, scrolling):
14884 (increment_row_positions): Remove.
14885 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14886 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14887 Now static.
14888 (redraw_garbaged_frames): Remove; unused.
14889
14890 * xfaces.c: Make symbols static if they're not exported.
14891 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14892 Remove decls.
14893 * xterm.h (defined_color): Remove decls.
14894 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14895 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14896 (menu_face_changed_default, defined_color, free_realized_face):
14897 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14898 (ascii_face_of_lisp_face): Remove; unused.
14899
14900 * xdisp.c: Make symbols static if they're not exported.
14901 * dispextern.h (scratch_glyph_row, window_box_edges):
14902 (glyph_to_pixel_coords, set_cursor_from_row):
14903 (get_next_display_element, set_iterator_to_next):
14904 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14905 (show_mouse_face): Remove decls
14906 * frame.h (message_buf_print): Likewise.
14907 * lisp.h (pop_message, set_message, check_point_in_composition):
14908 Likewise.
14909 * xterm.h (set_vertical_scroll_bar): Likewise.
14910 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14911 (message_buf_print, scratch_glyph_row, displayed_buffer):
14912 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14913 (get_next_display_element, show_mouse_face, window_box_edges):
14914 (frame_to_window_pixel_xy, check_point_in_composition):
14915 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14916 (glyph_to_pixel_coords): Remove; unused.
14917
14918 * dired.c (file_name_completion): Now static.
14919
14920 * dbusbind.c (xd_in_read_queued_messages): Now static.
14921
14922 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14923 * data.c (circular_list_error): Remove.
14924
14925 * commands.h (last_point_position, last_point_position_buffer):
14926 (last_point_position_window): Remove decls.
14927 * keyboard.c: Make these variables static.
14928
14929 * coding.h (coding, code_convert_region, encode_coding_gap):
14930 Remove decls.
14931 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14932 (iso_code_class, detect_coding, code_convert_region): Now static.
14933 (encode_coding_gap): Remove; unused.
14934
14935 * chartab.c (chartab_chars, chartab_bits): Now static.
14936
14937 * charset.h (charset_iso_8859_1): Remove decl.
14938 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14939 Now static.
14940
14941 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14942 * ccl.c (Vccl_program_table): Now static.
14943 (check_ccl_update): Remove; unused.
14944
14945 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14946 * category.h: ... from here.
14947 * category.c (check_category_table, set_category_set): Now static.
14948
14949 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14950 * lisp.h: Remove these decls.
14951
14952 * buffer.c (buffer_count): Remove unused var.
14953
14954 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14955 so that it's not optimized away.
14956 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14957 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14958 exported only to the debugger.
14959
14960 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
14961 * atimer.h (run_all_atimers): Remove; not exported.
14962
14963 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14964 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14965 was inaccessible from Lisp.
14966 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14967 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14968
14969 alloc.c: Import and export fewer symbols, and remove unused items.
14970 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14971 is defined.
14972 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14973 it's not optimized away by whole-program optimization.
14974 (message_enable_multibyte, free_misc): Remove.
14975 (catchlist, handlerlist, mark_backtrace):
14976 Declare only if BYTE_MARK_STACK.
14977 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14978 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14979 (message_enable_multibyte): Remove decl.
14980 (free_misc, interval_free_list, float_block, float_block_index):
14981 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14982 (cons_free_list, last_marked_index):
14983 Now static.
14984 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14985 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14986 (mark_backtrace): Define only if BYTE_MARK_STACK.
14987 * xdisp.c (message_enable_multibyte): Now static.
14988
14989 Declare Lisp_Object Q* variables to be 'static' if not exported.
14990 This makes it easier for human readers (and static analyzers)
14991 to see whether these variables are used from other modules.
14992 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14993 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14994 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14995 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14996 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14997 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14998 * xmenu.c, xselect.c:
14999 Declare Q* vars static if they are not used in other modules.
15000 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15001 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15002 Remove decls of unexported vars.
15003 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15004
15005 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15006
15007 Make Emacs functions such as Fatom 'static' by default.
15008 This makes it easier for human readers (and static analyzers)
15009 to see whether these functions can be called from other modules.
15010 DEFUN now defines a static function. To make the function external
15011 so that it can be used in other C modules, use the new macro DEFUE.
15012 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15013 (Finit_image_library):
15014 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15015 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15016 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15017 Remove decls, since these functions are now static.
15018 (Funintern, Fget_internal_run_time): New decls, since these functions
15019 were already external.
15020
15021 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15022 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15023 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15024 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15025 * keyboard.c, keymap.c, lread.c:
15026 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15027 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15028 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15029 Mark functions with DEFUE instead of DEFUN,
15030 if they are used in other modules.
15031 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15032 decls for now-static functions.
15033 * buffer.h (Fdelete_overlay): Remove decl.
15034 * callproc.c (Fgetenv_internal): Mark as internal.
15035 * composite.c (Fremove_list_of_text_properties): Remove decl.
15036 (Fcomposition_get_gstring): New forward static decl.
15037 * composite.h (Fcomposite_get_gstring): Remove decl.
15038 * dired.c (Ffile_attributes): New forward static decl.
15039 * doc.c (Fdocumntation_property): New forward static decl.
15040 * eval.c (Ffetch_bytecode): New forward static decl.
15041 (Funintern): Remove extern decl; now in .h file where it belongs.
15042 * fileio.c (Fmake_symbolic_link): New forward static decl.
15043 * image.c (Finit_image_library): New forward static decl.
15044 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15045 * intervals.h (Fprevious_property_change):
15046 (Fremove_list_of_text_properties): Remove decls.
15047 * keyboard.c (Fthis_command_keys): Remove decl.
15048 (Fcommand_execute): New forward static decl.
15049 * keymap.c (Flookup_key): New forward static decl.
15050 (Fcopy_keymap): Now static.
15051 * keymap.h (Flookup_key): Remove decl.
15052 * process.c (Fget_process): New forward static decl.
15053 (Fprocess_datagram_address): Mark as internal.
15054 * syntax.c (Fsyntax_table_p): New forward static decl.
15055 (skip_chars): Remove duplicate decl.
15056 * textprop.c (Fprevious_property_change): New forward static decl.
15057 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15058 Now internal.
15059 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15060 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15061
15062 * editfns.c (Fformat): Remove unreachable code.
15063
15064 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15065
15066 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15067 change. (Bug#8496)
15068
15069 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15070
15071 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15072 when at ZV. (Bug#8487)
15073
15074 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15075
15076 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15077 (Bug#8437)
15078 * keyboard.c (parse_tool_bar_item): Likewise.
15079 * sound.c (sound_cleanup, alsa_close): Likewise.
15080 * termcap.c (tgetent): Likewise.
15081 * xfns.c (x_default_font_parameter): Likewise.
15082 * xsettings.c (read_and_apply_settings): Likewise.
15083
15084 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15085 (overrun_check_free): Protoize.
15086
15087 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15088
15089 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15090 since callers should never pass a negative size.
15091 Change the signature to match that of plain 'read' and 'write'; see
15092 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15093 * lisp.h: Update prototypes of emacs_write and emacs_read.
15094
15095 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15096
15097 * xdisp.c (redisplay_window): Don't try to determine the character
15098 position of the scroll margin if the window start point w->startp
15099 is outside the buffer's accessible region. (Bug#8468)
15100
15101 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15102
15103 Fix write-region and its subroutines for buffers > 2GB.
15104 * fileio.c (a_write, e_write): Modify declaration of arguments and
15105 local variables to support buffers larger than 2GB.
15106 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15107
15108 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15109 argument, local variables, and return value.
15110
15111 * lisp.h: Update prototypes of emacs_write and emacs_read.
15112
15113 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15114
15115 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15116
15117 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15118
15119 Fix more problems found by GCC 4.6.0's static checks.
15120
15121 * xdisp.c (vmessage): Use a better test for character truncation.
15122
15123 * charset.c (load_charset_map): <, not <=, for optimization,
15124 and to avoid potential problems with integer overflow.
15125 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15126 * casetab.c (set_identity, shuffle): Likewise.
15127 * editfns.c (Fformat): Likewise.
15128 * syntax.c (skip_chars): Likewise.
15129
15130 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15131 This also lets GCC 4.6.0 generate slightly better loop code.
15132
15133 * callint.c (Fcall_interactively): <, not <=, for optimization.
15134 (Fcall_interactively): Count the number of arguments produced,
15135 not the number of arguments given. This is simpler and lets GCC
15136 4.6.0 generate slightly better code.
15137
15138 * ftfont.c: Distingish more carefully between FcChar8 and char.
15139 The previous code passed unsigned char * to a functions like
15140 strlen and xstrcasecmp that expect char *, which does not
15141 conform to the C standard.
15142 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15143 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15144 char * when the C standard requires it.
15145
15146 * keyboard.c (read_char): Remove unused var.
15147
15148 * eval.c: Port to Windows vsnprintf (Bug#8435).
15149 Include <limits.h>.
15150 (SIZE_MAX): Define if the headers do not.
15151 (verror): Do not give up if vsnprintf returns a negative count.
15152 Instead, grow the buffer. This ports to Windows vsnprintf, which
15153 does not conform to C99. Problem reported by Eli Zaretskii.
15154 Also, simplify the allocation scheme, by avoiding the need for
15155 calling realloc, and removing the ALLOCATED variable.
15156
15157 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15158
15159 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15160 But keep the doprint source code for now, as we might revamp it
15161 and use it again (Bug#8435).
15162 * lisp.h (doprnt): Remove.
15163 * Makefile.in (base_obj): Remove doprnt.o.
15164 * deps.mk (doprnt.o): Remove.
15165
15166 error: Print 32- and 64-bit integers portably (Bug#8435).
15167 Without this change, on typical 64-bit hosts error ("...%d...", N)
15168 was used to print both 32- and 64-bit integers N, which relied on
15169 undefined behavior.
15170 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15171 * lisp.h (error, verror): Mark as printf-like functions.
15172 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15173 Report overflow in size calculations when allocating printf buffer.
15174 Do not truncate output string at its first null byte.
15175 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15176 Truncate the output at a character boundary, since vsnprintf does not
15177 do that.
15178 * charset.c (check_iso_charset_parameter): Convert internal
15179 character to string before calling 'error', since %c now has the
15180 printf meaning.
15181 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15182 overflow when computing char to be passed to 'error'. Do not
15183 pass Lisp_Object to 'error'; pass the integer instead.
15184 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15185 formatted with plain %d.
15186
15187 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15188
15189 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15190
15191 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15192
15193 * xterm.c (x_catch_errors): Remove duplicate declaration.
15194
15195 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15196
15197 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15198
15199 2011-04-10 Jim Meyering <meyering@redhat.com>
15200
15201 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15202 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15203 return ssize_t not "int", and use size_t as the buffer length.
15204 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15205 * gnutls.h: Update declarations.
15206 * process.c (read_process_output): Use ssize_t, to match.
15207 (send_process): Likewise.
15208
15209 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15210
15211 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15212
15213 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15214
15215 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15216 Use unsigned char, to match FcChar8 type definition.
15217
15218 * xterm.c (handle_one_xevent):
15219 * xmenu.c (create_and_show_popup_menu):
15220 * xselect.c (x_decline_selection_request)
15221 (x_reply_selection_request): Avoid type-punned deref of X events.
15222
15223 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15224
15225 Fix some uses of `int' instead of EMACS_INT.
15226 * search.c (string_match_1, fast_string_match)
15227 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15228 (scan_buffer, find_next_newline_no_quit)
15229 (find_before_next_newline, search_command, Freplace_match)
15230 (Fmatch_data): Make some `int' variables be EMACS_INT.
15231
15232 * xdisp.c (display_count_lines): 3rd argument and return value now
15233 EMACS_INT. All callers changed.
15234 (pint2hrstr): Last argument is now EMACS_INT.
15235
15236 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15237 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15238 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15239 (decode_coding_utf_16, decode_coding_emacs_mule)
15240 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15241 (decode_coding_ccl, decode_coding_charset)
15242 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15243 (decode_coding_iso_2022, decode_coding_emacs_mule)
15244 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15245 <char_offset, last_offset>: Declare EMACS_INT.
15246 (encode_coding_utf_8, encode_coding_utf_16)
15247 (encode_coding_emacs_mule, encode_invocation_designation)
15248 (encode_designation_at_bol, encode_coding_iso_2022)
15249 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15250 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15251 Declare EMACS_INT.
15252 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15253 (encode_invocation_designation): Last argument P_NCHARS is now
15254 EMACS_INT.
15255 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15256 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15257
15258 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15259 All users changed.
15260
15261 * ccl.c (Fccl_execute_on_string): Declare some variables
15262 EMACS_INT.
15263
15264 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15265
15266 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15267
15268 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15269
15270 * process.c (Fformat_network_address): Doc fix.
15271
15272 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15273
15274 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15275
15276 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15277
15278 * keyboard.c (read_char): Call Lisp function help-form-show,
15279 instead of using internal_with_output_to_temp_buffer.
15280 (Qhelp_form_show): New var.
15281 (syms_of_keyboard): Use DEFSYM macro.
15282
15283 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15284
15285 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15286
15287 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15288
15289 * process.c (Flist_processes): Remove to Lisp.
15290 (list_processes_1): Delete.
15291
15292 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15293
15294 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15295
15296 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15297
15298 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15299
15300 Fix more problems found by GCC 4.6.0's static checks.
15301
15302 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15303
15304 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15305
15306 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15307
15308 * xdisp.c (vmessage): Mark as a printf-like function.
15309
15310 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15311
15312 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15313
15314 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15315 printf-like functions.
15316 (tiff_load): Add casts to remove these marks before passing them
15317 to system-supplied API.
15318
15319 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15320
15321 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15322 This avoids several warnings with gcc -Wstrict-overflow.
15323 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15324 directly, rather than having caller test rule sign. This avoids
15325 some unnecessary tests.
15326 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15327 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15328 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15329
15330 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15331 (xfont_open): Avoid unnecessary tests.
15332
15333 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15334
15335 * composite.h, composite.c (composition_gstring_put_cache):
15336 Use EMACS_INT, not int, for length.
15337
15338 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15339 breaking out part of COMPOSITION_DECODE_RULE.
15340 (COMPOSITION_DECODE_RULE): Use it.
15341 * composite.c (get_composition_id): Remove unused local vars,
15342 by using the new macro.
15343
15344 * textprop.c (set_text_properties_1): Change while to do-while,
15345 since the condition is always true at first.
15346
15347 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15348 (interval_deletion_adjustment): Return unsigned value.
15349 All uses changed.
15350
15351 * process.c (list_processes_1, create_pty, read_process_output):
15352 (exec_sentinel): Remove vars that were set but not used.
15353 (create_pty): Remove unnecessary "volatile"s.
15354 (Fnetwork_interface_info): Avoid possibility of int overflow.
15355 (read_process_output): Do adaptive read buffering even if carryover.
15356 (read_process_output): Simplify nbytes computation if buffered.
15357
15358 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15359
15360 * syntax.c (scan_words): Remove var that was set but not used.
15361 (update_syntax_table): Use unsigned instead of int.
15362
15363 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15364 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15365 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15366
15367 * print.c (print_error_message): Avoid int overflow.
15368
15369 * font.c (font_list_entities): Redo for clarity,
15370 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15371
15372 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15373 (font_score): Avoid potential overflow in diff calculation.
15374
15375 * fns.c (substring_both): Remove var that is set but not used.
15376 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15377
15378 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15379
15380 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15381 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15382 can always succeed if overflow has undefined behavior.
15383
15384 * search.c (boyer_moore, wordify): Remove vars set but not used.
15385 (wordify): Omit three unnecessary tests.
15386
15387 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15388 All callers changed. This avoids the need for an unused var.
15389
15390 * casefiddle.c (casify_region): Remove var that is set but not used.
15391
15392 * dired.c (file_name_completion): Remove var that is set but not used.
15393
15394 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15395
15396 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15397 (Finsert_file_contents): Remove unnecessary code checking fd.
15398
15399 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15400 Check for integer overflow on size calculations.
15401
15402 * buffer.c (Fprevious_overlay_change): Remove var that is set
15403 but not used.
15404
15405 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15406 Remove vars that are set but not used.
15407 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
15408 (timer_check_2): Mark vars as initialized.
15409
15410 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15411
15412 * image.c (lookup_image): Remove var that is set but not used.
15413 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
15414
15415 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15416 that are set but not used.
15417
15418 * xfns.c (make_invisible_cursor): Don't return garbage
15419 if XCreateBitmapFromData fails (Bug#8410).
15420
15421 * xselect.c (x_get_local_selection, x_handle_property_notify):
15422 Remove vars that are set but not used.
15423
15424 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15425 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15426
15427 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15428 Remove var that is set but not used.
15429 (scroll_bar_windows_size): Now size_t, not int.
15430 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15431 Check for overflow.
15432
15433 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15434 (map_tty_color) [!defined MSDOS]: Likewise.
15435
15436 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15437
15438 * coding.c: Remove vars that are set but not used.
15439 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15440 All callers changed.
15441 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15442 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15443 (decode_coding_charset): Remove vars that are set but not used.
15444
15445 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15446 that is set but not used.
15447
15448 * print.c (print_object): Remove var that is set but not used.
15449
15450 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
15451 The gnulib version avoids calling malloc in the usual case,
15452 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15453 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15454 * filelock.c (current_lock_owner): Likewise.
15455 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15456 * sysdep.c: Include allocator.h, careadlinkat.h.
15457 (emacs_no_realloc_allocator): New static constant.
15458 (emacs_readlink): New function.
15459 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15460 ../lib/careadlinkat.h.
15461
15462 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15463
15464 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15465 first non-nil return value).
15466
15467 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15468
15469 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15470 if not defined (Bug#8403).
15471
15472 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15473
15474 * xdisp.c (display_count_lines): Remove parameter `start',
15475 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15476 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15477 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15478 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15479 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15480 and thereabouts. All callers changed.
15481 (get_per_char_metric): Remove parameter `f', unused since
15482 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15483
15484 2011-04-02 Jim Meyering <meyering@redhat.com>
15485
15486 do not dereference NULL upon failed strdup
15487 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15488 (ns_get_family): Likewise.
15489
15490 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15491
15492 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15493
15494 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15495
15496 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15497 later (Bug#8403).
15498
15499 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15500
15501 Add lexical binding.
15502
15503 * window.c (Ftemp_output_buffer_show): New fun.
15504 (Fsave_window_excursion):
15505 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15506
15507 * lread.c (lisp_file_lexically_bound_p): New function.
15508 (Fload): Bind Qlexical_binding.
15509 (readevalloop): Remove `evalfun' arg.
15510 Bind Qinternal_interpreter_environment.
15511 (Feval_buffer): Bind Qlexical_binding.
15512 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15513 Mark as dynamic.
15514 (syms_of_lread): Declare `lexical-binding'.
15515
15516 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15517
15518 * keyboard.c (eval_dyn): New fun.
15519 (menu_item_eval_property): Use it.
15520
15521 * image.c (parse_image_spec): Use Ffunctionp.
15522
15523 * fns.c (concat, mapcar1): Accept byte-code-functions.
15524
15525 * eval.c (Fsetq): Handle lexical vars.
15526 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15527 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15528 (FletX, Flet): Obey lexical binding.
15529 (Fcommandp): Handle closures.
15530 (Feval): New `lexical' arg.
15531 (eval_sub): New function extracted from Feval. Use it almost
15532 everywhere where Feval was used. Look up vars in lexical env.
15533 Handle closures.
15534 (Ffunctionp): Move from subr.el.
15535 (Ffuncall): Handle closures.
15536 (apply_lambda): Remove `eval_flags'.
15537 (funcall_lambda): Handle closures and new byte-code-functions.
15538 (Fspecial_variable_p): New function.
15539 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15540 but without exporting it to Lisp.
15541
15542 * doc.c (Fdocumentation, store_function_docstring):
15543 * data.c (Finteractive_form): Handle closures.
15544
15545 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15546 interactive spec.
15547
15548 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15549 New byte-codes.
15550 (exec_byte_code): New function extracted from Fbyte_code to handle new
15551 calling convention for byte-code-functions. Add new byte-codes.
15552
15553 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
15554
15555 * alloc.c (Fmake_symbol): Init new `declared_special' field.
15556
15557 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15558
15559 * xdisp.c (redisplay_internal): Fix prototype.
15560
15561 2011-03-31 Eli Zaretskii <eliz@gnu.org>
15562
15563 * xdisp.c (SCROLL_LIMIT): New macro.
15564 (try_scrolling): Use it when setting scroll_limit.
15565 Limit scrolling to 100 screen lines.
15566 (redisplay_window): Even when falling back on "recentering",
15567 position point in the window according to scroll-conservatively,
15568 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15569
15570 (try_scrolling): When point is above the window, allow searching
15571 as far as scroll_max, or one screenful, to compute vertical
15572 distance from PT to the scroll margin position. This prevents
15573 try_scrolling from unnecessarily failing when
15574 scroll-conservatively is set to a value slightly larger than the
15575 window height. Clean up the case of PT below the margin at bottom
15576 of window: scroll_max can no longer be INT_MAX. When aggressive
15577 scrolling is in use, don't let point enter the opposite scroll
15578 margin as result of the scroll.
15579 (syms_of_xdisp) <scroll-conservatively>: Document the
15580 threshold of 100 lines for never-recentering scrolling.
15581
15582 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15583
15584 * dispextern.h (move_it_by_lines):
15585 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15586 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15587 (message_log_check_duplicate): Remove parameters `prev_bol' and
15588 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15589 (redisplay_internal): Remove parameter `preserve_echo_area',
15590 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15591
15592 * indent.c (Fvertical_motion):
15593 * window.c (window_scroll_pixel_based, Frecenter):
15594 Don't pass `need_y_p' to `move_it_by_lines'.
15595
15596 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15597
15598 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15599 steal a few bits to be more compact.
15600 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15601 Remove unneeded casts.
15602
15603 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15604
15605 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15606
15607 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15608 binding" message (bug#7967).
15609
15610 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15611
15612 Fix more problems found by GCC 4.6.0's static checks.
15613
15614 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15615 Remove unused local var.
15616
15617 * editfns.c (Fmessage_box): Remove unused local var.
15618
15619 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15620 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15621 Omit unused local vars.
15622 * window.c (shrink_windows): Omit unused local var.
15623 * menu.c (digest_single_submenu): Omit unused local var.
15624 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15625 Omit unused local var.
15626
15627 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15628 Don't assume string length fits in int.
15629 (keyremap_step, read_key_sequence): Use size_t for sizes.
15630 (read_key_sequence): Don't check last_real_key_start redundantly.
15631
15632 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15633 instead of alloca (Bug#8344).
15634
15635 * eval.c (Fbacktrace): Don't assume nargs fits in int.
15636 (Fbacktrace_frame): Don't assume nframes fits in int.
15637
15638 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15639
15640 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15641 concerns.
15642
15643 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15644
15645 * cm.c (calccost): Turn while-do into do-while, for clarity.
15646
15647 * keyboard.c (syms_of_keyboard): Use the same style as later
15648 in this function when indexing through an array. This also
15649 works around GCC bug 48267.
15650
15651 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15652
15653 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15654
15655 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15656 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15657
15658 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15659 This avoids undefined behavior on integer overflow, and is a bit
15660 more convenient anyway since it is compared to a size_t variable.
15661
15662 Variadic C functions now count arguments with size_t, not int.
15663 This avoids an unnecessary limitation on 64-bit machines, which
15664 caused (substring ...) to crash on large vectors (Bug#8344).
15665 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15666 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
15667 All variadic functions and their callers changed accordingly.
15668 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15669 * data.c (arith_driver, float_arith_driver): Likewise.
15670 * editfns.c (general_insert_function): Likewise.
15671 * eval.c (struct backtrace.nargs, interactive_p)
15672 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15673 (funcall_lambda, mark_backtrace): Likewise.
15674 * fns.c (concat): Likewise.
15675 * frame.c (x_set_frame_parameters): Likewise.
15676 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15677 0 if not found, not -1. All callers changed.
15678
15679 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15680 (stack_copy_size): Now size_t, not int.
15681 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15682
15683 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15684
15685 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15686 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15687 All callers changed.
15688
15689 * lisp.h (multibyte_char_to_unibyte):
15690 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15691 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15692 * character.h (CHAR_TO_BYTE8):
15693 * cmds.c (internal_self_insert):
15694 * editfns.c (general_insert_function):
15695 * keymap.c (push_key_description):
15696 * search.c (Freplace_match):
15697 * xdisp.c (message_dolog, set_message_1): All callers changed.
15698
15699 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15700
15701 * keyboard.c (safe_run_hook_funcall): New function.
15702 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15703 don't set the hook to nil, but remove the offending function instead.
15704 (Qcommand_hook_internal): Remove, unused.
15705 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15706 Vcommand_hook_internal.
15707
15708 * eval.c (enum run_hooks_condition): Remove.
15709 (funcall_nil, funcall_not): New functions.
15710 (run_hook_with_args): Call each function through a `funcall' argument.
15711 Remove `cond' argument, now redundant.
15712 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15713 (Frun_hook_with_args_until_failure): Adjust accordingly.
15714 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15715
15716 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15717
15718 * dispextern.h (string_buffer_position): Remove declaration.
15719
15720 * print.c (strout): Remove parameter `multibyte', unused since
15721 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15722
15723 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15724 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15725 All callers changed.
15726
15727 * w32.c (_wsa_errlist): Use braces for struct initializers.
15728
15729 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15730 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15731 All callers changed.
15732 (string_buffer_position): Likewise. Also, make static (it's never
15733 used outside xdisp.c).
15734 (cursor_row_p): Remove parameter `w', unused since
15735 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15736 (decode_mode_spec): Remove parameter `precision', introduced during
15737 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15738 All callers changed.
15739
15740 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15741
15742 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15743
15744 2011-03-27 Anders Lindgren <andlind@gmail.com>
15745
15746 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15747 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15748 (ns_update_auto_hide_menu_bar): New functions.
15749 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15750 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15751 ns_constrain_all_frames.
15752 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15753 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15754
15755 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15756
15757 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15758
15759 2011-03-27 Glenn Morris <rgm@gnu.org>
15760
15761 * syssignal.h: Replace RETSIGTYPE with void.
15762 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15763 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15764 Replace SIGTYPE with void everywhere.
15765 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15766 * s/template.h (SIGTYPE): Remove commented out definition.
15767
15768 2011-03-26 Eli Zaretskii <eliz@gnu.org>
15769
15770 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15771 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15772
15773 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
15774
15775 * w32.c (read_unc_volume): Use parameter `henum', instead of
15776 global variable `wget_enum_handle'.
15777
15778 * keymap.c (describe_vector): Remove parameters `indices' and
15779 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15780 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15781
15782 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15783
15784 * keyboard.c (timer_check): Remove parameter `do_it_now',
15785 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15786 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15787 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15788
15789 * keyboard.c (read_char):
15790 * w32menu.c (w32_menu_display_help):
15791 * xmenu.c (show_help_event, menu_help_callback):
15792 Adjust calls to `show_help_echo'.
15793
15794 * gtkutil.c (xg_maybe_add_timer):
15795 * keyboard.c (readable_events):
15796 * process.c (wait_reading_process_output):
15797 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15798
15799 * insdel.c (adjust_markers_gap_motion):
15800 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15801 (gap_left, gap_right): Don't call it.
15802
15803 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
15804
15805 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15806 incurred during fontification.
15807
15808 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15809
15810 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15811 (DEFVAR_PER_BUFFER): Don't pass it.
15812
15813 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15814 (scrolling_window): Don't pass it.
15815
15816 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15817
15818 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15819
15820 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15821 and `suffix'.
15822 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15823 of variables specific to SELinux and computation of `encoded_absname'.
15824
15825 * image.c (XPutPixel): Remove unused variable `height'.
15826
15827 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15828
15829 * unexw32.c (get_section_info): Remove unused variable `section'.
15830
15831 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15832 (system_process_attributes): Remove unused variable `sess'.
15833 (sys_read): Remove unused variable `err'.
15834
15835 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15836 (w32_wnd_proc): Remove unused variable `isdead'.
15837 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15838 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15839 (x_create_tip_frame): Remove unused variable `tem'.
15840
15841 * w32inevt.c (w32_console_read_socket):
15842 Remove unused variable `no_events'.
15843
15844 * w32term.c (x_draw_composite_glyph_string_foreground):
15845 Remove unused variable `width'.
15846
15847 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
15848
15849 * w32term.c (x_set_glyph_string_clipping):
15850 Don't pass uninitialized region to CombineRgn.
15851
15852 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
15853
15854 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15855 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15856 (Fx_close_connection): Remove unused variable `i'.
15857
15858 * w32font.c (w32font_draw): Return number of glyphs.
15859 (w32font_open_internal): Remove unused variable `i'.
15860 (w32font_driver): Add missing initializer.
15861
15862 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15863 (fill_in_menu): Remove unused variable `items_added'.
15864
15865 * w32term.c (last_mouse_press_frame): Remove static global variable.
15866 (w32_clip_to_row): Remove unused variable `f'.
15867 (x_delete_terminal): Remove unused variable `i'.
15868
15869 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15870 (NOTHING): Remove unused static global variable.
15871 (uniscribe_check_otf): Remove unused variable `table'.
15872 (uniscribe_font_driver): Add missing initializers.
15873
15874 2011-03-23 Julien Danjou <julien@danjou.info>
15875
15876 * term.c (Fsuspend_tty, Fresume_tty):
15877 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15878 * window.c (temp_output_buffer_show):
15879 * insdel.c (signal_before_change):
15880 * frame.c (Fhandle_switch_frame):
15881 * fileio.c (Fdo_auto_save):
15882 * emacs.c (Fkill_emacs):
15883 * editfns.c (save_excursion_restore):
15884 * cmds.c (internal_self_insert):
15885 * callint.c (Fcall_interactively):
15886 * buffer.c (Fkill_all_local_variables):
15887 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15888 Use Frun_hooks.
15889 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
15890 unconditionally since it does the check itself.
15891
15892 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
15893
15894 Fix more problems found by GCC 4.5.2's static checks.
15895
15896 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15897 the first time through the loop, since we know p0 < p1 then.
15898 This also avoids a gcc -Wstrict-overflow warning.
15899
15900 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15901 leading to a memory leak, possible in functions like
15902 load_charset_map_from_file that can allocate an unbounded number
15903 of objects (Bug#8318).
15904
15905 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15906 that could (at least in theory) be that large.
15907
15908 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15909 This is less likely to overflow, and avoids undefined behavior if
15910 overflow does occur. All callers changed. Use strtoul to scan
15911 for the unsigned long integer.
15912 (pint2hrstr): Simplify and tune code slightly.
15913 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
15914
15915 * scroll.c (do_scrolling): Work around GCC bug 48228.
15916 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15917
15918 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15919 This also avoids a warning with gcc -Wstrict-overflow.
15920 (validate_x_resource_name): Simplify count usage.
15921 This also avoids a warning with gcc -Wstrict-overflow.
15922
15923 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15924 fail (Bug#8306).
15925
15926 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
15927
15928 * process.c (Fmake_network_process): Use socklen_t, not int,
15929 where POSIX says socklen_t is required in portable programs.
15930 This fixes a porting bug on hosts like 64-bit HP-UX, where
15931 socklen_t is wider than int (Bug#8277).
15932 (Fmake_network_process, server_accept_connection):
15933 (wait_reading_process_output, read_process_output):
15934 Likewise.
15935
15936 * process.c: Rename or move locals to avoid shadowing.
15937 (list_processes_1, Fmake_network_process):
15938 (read_process_output_error_handler, exec_sentinel_error_handler):
15939 Rename or move locals.
15940 (Fmake_network_process): Define label "retry_connect" only if needed.
15941 (Fnetwork_interface_info): Fix pointer signedness.
15942 (process_send_signal): Add cast to avoid pointer signedness problem.
15943 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
15944 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
15945
15946 Make tparam.h and terminfo.c consistent.
15947 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15948 Include tparam.h instead, since it declares them.
15949 * cm.h (PC): Remove extern decl; tparam.h now does this.
15950 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15951 * terminfo.c: Include tparam.h, to check interfaces.
15952 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15953 (tparam): Adjust signature to match interface in tparam.h;
15954 this removes some undefined behavior. Check that outstring and len
15955 are zero, which they always are with Emacs.
15956 * tparam.h (PC, BC, UP): New extern decls.
15957
15958 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
15959 (xftfont_open): Rename locals to avoid shadowing.
15960
15961 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
15962 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15963 (OTF_TAG_SYM): Omit macro if not needed.
15964 (ftfont_list): Remove unused local.
15965 (get_adstyle_property, ftfont_pattern_entity):
15966 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15967 Rename locals to avoid shadowing.
15968
15969 * xfont.c (xfont_list_family): Mark var as initialized.
15970
15971 * xml.c (make_dom): Now static.
15972
15973 * composite.c (composition_compute_stop_pos): Rename local to
15974 avoid shadowing.
15975 (composition_reseat_it): Remove unused locals.
15976 (find_automatic_composition, composition_adjust_point): Likewise.
15977 (composition_update_it): Mark var as initialized.
15978 (find_automatic_composition): Mark vars as initialized,
15979 with a FIXME (Bug#8290).
15980
15981 character.h: Rename locals to avoid shadowing.
15982 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15983 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15984 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15985 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15986 to avoid shadowing.
15987
15988 * textprop.c (property_change_between_p): Remove; unused.
15989
15990 * intervals.c (interval_start_pos): Now static.
15991
15992 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15993
15994 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15995 Rename locals to avoid shadowing.
15996
15997 * sound.c (wav_play, au_play, Fplay_sound_internal):
15998 Fix pointer signedness.
15999 (alsa_choose_format): Remove unused local var.
16000 (wav_play): Initialize a variable to 0, to prevent undefined
16001 behavior (Bug#8278).
16002
16003 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16004
16005 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16006
16007 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16008 clobbering (Bug#8298).
16009 * sysdep.c (sys_subshell): Likewise.
16010 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16011
16012 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16013 This should get cleaned up, so that child_setup has the
16014 same signature on all platforms.
16015
16016 * callproc.c (call_process_cleanup): Now static.
16017 (relocate_fd): Rename locals to avoid shadowing.
16018
16019 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16020
16021 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16022 not to be necessary, and produces flickering.
16023
16024 2011-03-20 Glenn Morris <rgm@gnu.org>
16025
16026 * config.in: Remove file.
16027
16028 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16029
16030 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16031 are now in src/globals.h.
16032 (syms_of_minibuf): Remove spurious & from previous change.
16033
16034 2011-03-20 Leo Liu <sdl.web@gmail.com>
16035
16036 * minibuf.c (completing-read-function): New variable.
16037 (completing-read-default): Rename from completing-read.
16038 (completing-read): Call completing-read-function.
16039
16040 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16041
16042 * xfaces.c (Fx_load_color_file):
16043 Read color file from absolute filename (bug#8250).
16044
16045 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16046
16047 * makefile.w32-in: Update dependencies.
16048
16049 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16050
16051 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16052
16053 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16054
16055 Fix more problems found by GCC 4.5.2's static checks.
16056
16057 * process.c (make_serial_process_unwind, send_process_trap):
16058 (sigchld_handler): Now static.
16059
16060 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16061 That way, the code declares only the vars that it needs.
16062 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16063 * s/cygwin.h (PTY_ITERATION): Likewise.
16064 * s/darwin.h (PTY_ITERATION): Likewise.
16065 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16066
16067 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16068 * process.c (allocate_pty): Don't declare stb unless it's needed.
16069
16070 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16071 (CONSTANTLIM): Remove; unused.
16072 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16073 Define only if needed.
16074
16075 * unexelf.c (unexec): Name an expression,
16076 to avoid gcc -Wbad-function-cast warning.
16077 Use a different way to cause a compilation error if anyone uses
16078 n rather than nn, a way that does not involve shadowing.
16079 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16080
16081 * deps.mk (unexalpha.o): Remove; unused.
16082
16083 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16084 * unexec.h: New file.
16085 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16086 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16087 Depend on unexec.h.
16088 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16089 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16090 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16091 Change as necessary to match prototype in unexec.h.
16092
16093 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16094 shadowing.
16095 (back_comment, skip_chars): Mark vars as initialized.
16096
16097 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16098 Rename locals to avoid shadowing.
16099
16100 * lread.c (read1): Rewrite so as not to use empty "else".
16101 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16102
16103 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16104
16105 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16106 warning when compiling print.c.
16107
16108 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16109 instead of using an uninitialized var.
16110 (font_sort_entities): Mark var as initialized.
16111
16112 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16113
16114 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16115 pointers to constants.
16116 (font_parse_fcname): Remove unused vars.
16117 (font_delete_unmatched): Now static.
16118 (font_get_spec): Remove; unused.
16119 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16120 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16121 Rename or move locals to avoid shadowing.
16122
16123 * fns.c (require_nesting_list, require_unwind): Now static.
16124 (Ffillarray): Rename locals to avoid shadowing.
16125
16126 * floatfns.c (domain_error2): Define only if needed.
16127 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16128
16129 * alloc.c (mark_backtrace): Move decl from here ...
16130 * lisp.h: ... to here, so that it can be checked.
16131
16132 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16133 (Fdefvar): Rewrite so as not to use empty "else".
16134 (lisp_indirect_variable): Name an expression,
16135 to avoid gcc -Wbad-function-cast warning.
16136 (Fdefvar): Rename locals to avoid shadowing.
16137
16138 * callint.c (quotify_arg, quotify_args): Now static.
16139 (Fcall_interactively): Rename locals to avoid shadowing.
16140 Use const pointer when appropriate.
16141
16142 * lisp.h (get_system_name, get_operating_system_release):
16143 Move decls here, to check interfaces.
16144 * process.c (get_operating_system_release): Move decl to lisp.h.
16145 * xrdb.c (get_system_name): Likewise.
16146 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16147 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16148 some of which prompt warnings from gcc -Wbad-function-cast.
16149 (Fformat_time_string, Fencode_time, Finsert_char):
16150 (Ftranslate_region_internal, Fformat):
16151 Rename or remove local vars to avoid shadowing.
16152 (Ftranslate_region_internal): Mark var as initialized.
16153
16154 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16155 avoid shadowing.
16156
16157 * lisp.h (eassert): Check that the argument compiles, even if
16158 ENABLE_CHECKING is not defined.
16159
16160 * data.c (Findirect_variable): Name an expression, to avoid
16161 gcc -Wbad-function-cast warning.
16162 (default_value, arithcompare, arith_driver, arith_error): Now static.
16163 (store_symval_forwarding): Rename local to avoid shadowing.
16164 (Fmake_variable_buffer_local, Fmake_local_variable):
16165 Mark variables as initialized.
16166 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16167
16168 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16169 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16170 Rename locals to avoid shadowing.
16171 (mark_stack): Move local variables into the #ifdef region where
16172 they're used.
16173 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16174 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16175 needed otherwise.
16176 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16177 (GC_STRING_CHARS): Remove; not used.
16178 (Fmemory_limit): Cast sbrk's returned value to char *.
16179
16180 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16181 avoids undefined behavior in theory.
16182
16183 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16184
16185 Use functions, not macros, for up- and down-casing (Bug#8254).
16186 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16187 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16188 to use the following functions instead of these macros.
16189 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16190 EMACS_INT, since callers assume the returned value fits in int.
16191 (upcase1): Likewise, for UPCASE_TABLE.
16192 (uppercasep, lowercasep, upcase): New static inline functions.
16193 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16194 the race-condition problem in the old DOWNCASE.
16195
16196 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16197 Rename locals to avoid shadowing.
16198 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16199 (regex_compile, re_search_2, re_match_2_internal):
16200 Remove unused local vars.
16201 (FREE_VAR): Rewrite so as not to use empty "else",
16202 which gcc can warn about.
16203 (regex_compile, re_match_2_internal): Mark locals as initialized.
16204 (RETALLOC_IF): Define only if needed.
16205 (WORDCHAR_P): Likewise. This one is never needed, but is used
16206 only in a comment talking about a compiler bug, so put inside
16207 the #if 0 of that comment.
16208 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16209 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16210 Remove; unused.
16211
16212 * search.c (boyer_moore): Rename locals to avoid shadowing.
16213 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16214 (PREV_CHAR_BOUNDARY): Likewise.
16215
16216 * search.c (simple_search): Remove unused var.
16217
16218 * dired.c (compile_pattern): Move decl from here ...
16219 * lisp.h: ... to here, so that it can be checked.
16220 (struct re_registers): New forward decl.
16221
16222 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16223
16224 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16225 All uses changed.
16226 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16227 Rename locals to avoid shadowing.
16228 (Fvertical_motion): Mark locals as initialized.
16229
16230 * casefiddle.c (casify_object, casify_region): Now static.
16231 (casify_region): Mark local as initialized.
16232
16233 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16234
16235 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16236 New macros, so that the caller can use some names other than
16237 gcpro1, gcpro2, etc.
16238 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16239 of the new macros.
16240 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16241 argument, for consistency with GCPRO2_VAR, etc: it is now the
16242 prefix of the variable, not the variable itself. All uses
16243 changed.
16244 * dired.c (directory_files_internal, file_name_completion):
16245 Rename locals to avoid shadowing.
16246
16247 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16248 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16249 dired.c's scmp function, had undefined behavior.
16250 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16251 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16252 * buffer.h: ... to here, because these macros use current_buffer,
16253 and the new implementation with inline functions needs to have
16254 current_buffer in scope now, rather than later when the macros
16255 are used.
16256 (downcase, upcase1): New static inline functions.
16257 (DOWNCASE, UPCASE1): Reimplement using these functions.
16258 This avoids undefined behavior in expressions like
16259 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16260 from race conditions in accessing the global variables
16261 case_temp1 and case_temp2.
16262 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16263 * lisp.h (case_temp1, case_temp2): Remove their decls.
16264 * character.h (ASCII_CHAR_P): Move from here ...
16265 * lisp.h: ... to here, so that the inline functions mentioned
16266 above can use them.
16267
16268 * dired.c (directory_files_internal_unwind): Now static.
16269
16270 * fileio.c (file_name_as_directory, directory_file_name):
16271 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16272 Now static.
16273 (file_name_as_directory): Use const pointers when appropriate.
16274 (Fexpand_file_name): Likewise. In particular, newdir might
16275 point at constant storage, so make it a const pointer.
16276 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16277 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16278 signedness issues.
16279 (Fset_file_times, Finsert_file_contents, auto_save_error):
16280 Rename locals to avoid shadowing.
16281
16282 * minibuf.c (choose_minibuf_frame_1): Now static.
16283 (Ftry_completion, Fall_completions): Rename or remove locals
16284 to avoid shadowing.
16285
16286 * marker.c (bytepos_to_charpos): Remove; unused.
16287
16288 * lisp.h (verify_bytepos, count_markers): New decls,
16289 so that gcc does not warn that these functions aren't declared.
16290
16291 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16292 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16293 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16294 (copy_text): Remove unused local var.
16295
16296 * filelock.c (within_one_second): Now static.
16297 (lock_file_1): Rename local to avoid shadowing.
16298
16299 * buffer.c (fix_overlays_before): Mark locals as initialized.
16300 (fix_start_end_in_overlays): Likewise. This function should be
16301 simplified by using pointers-to-pointers, but that's a different
16302 matter.
16303 (switch_to_buffer_1): Now static.
16304 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16305 (report_overlay_modification): Rename locals to avoid shadowing.
16306
16307 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16308 Fix pointer signedness issue.
16309 (sys_subshell): Mark local as volatile if checking for lint,
16310 to suppress a gcc -Wclobbered warning that does not seem to be right.
16311 (MAXPATHLEN): Define only if needed.
16312
16313 * process.c (serial_open, serial_configure): Move decls from here ...
16314 * systty.h: ... to here, so that they can be checked.
16315
16316 * fns.c (get_random, seed_random): Move extern decls from here ...
16317 * lisp.h: ... to here, so that they can be checked.
16318
16319 * sysdep.c (reset_io): Now static.
16320 (wait_for_termination_signal): Remove; unused.
16321
16322 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16323 (copy_keymap_item, append_key, push_text_char_description):
16324 Now static.
16325 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16326 (DENSE_TABLE_SIZE): Remove; unused.
16327 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16328 (describe_map_tree):
16329 Rename locals to avoid shadowing.
16330
16331 * keyboard.c: Declare functions static if they are not used elsewhere.
16332 (echo_char, echo_dash, cmd_error, top_level_2):
16333 (poll_for_input, handle_async_input): Now static.
16334 (read_char, kbd_buffer_get_event, make_lispy_position):
16335 (make_lispy_event, make_lispy_movement, apply_modifiers):
16336 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16337 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16338 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
16339 (read_key_sequence, read_char): Mark locals as initialized.
16340 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
16341
16342 * keyboard.h (make_ctrl_char): New decl.
16343 (mark_kboards): Move decl here ...
16344 * alloc.c (mark_kboards): ... from here.
16345
16346 * lisp.h (force_auto_save_soon): New decl.
16347
16348 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
16349 (DEFINE_DUMMY_FUNCTION): New macro.
16350 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16351 Use it.
16352 (main): Add casts to avoid warnings
16353 if GCC considers string literals to be constants.
16354
16355 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16356
16357 * dbusbind.c: Pointer signedness fixes.
16358 (xd_signature, xd_append_arg, xd_initialize):
16359 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16360 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16361 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16362 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16363
16364 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16365 if GCC considers string literals to be constants.
16366 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16367
16368 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16369
16370 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16371 (print_preprocess, print_object): New macro to fix last change.
16372
16373 * print.c (print_preprocess): Don't forget font objects.
16374
16375 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16376
16377 * emacs.c (USAGE3): Doc fixes.
16378
16379 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16380
16381 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16382 structure.
16383
16384 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
16385
16386 * lisp.h (VWindow_system, Qfile_name_history):
16387 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16388 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16389 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16390
16391 * w32select.c: Don't #include "keyboard.h".
16392 (run_protected): Add extern declaration for waiting_for_input.
16393
16394 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16395 * w32console.c (detect_input_pending, read_input_pending)
16396 (encode_terminal_code):
16397 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16398 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16399 (w32_system_caret_y, Qfile_name_history):
16400 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16401 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16402 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16403 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16404 * w32proc.c (Qlocal, report_file_error):
16405 * w32term.c (Vwindow_system, updating_frame):
16406 * w32uniscribe.c (initialized, uniscribe_font_driver):
16407 Remove unneeded extern declarations.
16408
16409 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
16410
16411 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16412
16413 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
16414
16415 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16416 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16417 These macros can no longer be used for assignment.
16418
16419 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16420 Assign struct members directly, instead of using BUF_BEGV etc.
16421 (record_buffer_markers, fetch_buffer_markers): New functions for
16422 recording and fetching special buffer markers.
16423 (set_buffer_internal_1, set_buffer_temp): Use them.
16424
16425 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16426
16427 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16428
16429 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16430 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16431
16432 * xdisp.c (hscroll_window_tree):
16433 (reconsider_clip_changes): Use PT instead of BUF_PT.
16434
16435 2011-03-13 Eli Zaretskii <eliz@gnu.org>
16436
16437 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16438 $(EMACS_ROOT)/lib/intprops.h.
16439
16440 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16441
16442 Fix more problems found by GCC 4.5.2's static checks.
16443
16444 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16445 to unsigned char * to avoid compiler diagnostic.
16446 (xg_free_frame_widgets): Make it clear that a local variable is
16447 needed only if USE_GTK_TOOLTIP.
16448 (gdk_window_get_screen): Make it clear that this macro is needed
16449 only if USE_GTK_TOOLTIP.
16450 (int_gtk_range_get_value): New function, which avoids a diagnostic
16451 from gcc -Wbad-function-cast.
16452 (xg_set_toolkit_scroll_bar_thumb): Use it.
16453 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16454 diagnostic from gcc -Wbad-function-cast.
16455 (get_utf8_string, xg_get_file_with_chooser):
16456 Rename locals to avoid shadowing.
16457 (create_dialog): Move locals to avoid shadowing.
16458
16459 * xgselect.c (xg_select): Remove unused var.
16460
16461 * image.c (four_corners_best): Mark locals as initialized.
16462 (gif_load): Initialize transparent_p to zero (Bug#8238).
16463 Mark another local as initialized.
16464 (my_png_error, my_error_exit): Mark with NO_RETURN.
16465
16466 * image.c (clear_image_cache): Now static.
16467 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
16468 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
16469 (x_edge_detection): Remove unnecessary cast that
16470 gcc -Wbad-function-cast diagnoses.
16471 (gif_load): Fix pointer signedness.
16472 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16473 (jpeg_load, gif_load): Rename locals to avoid shadowing.
16474
16475 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
16476
16477 Improve quality of tests for time stamp overflow.
16478 For example, without this patch (encode-time 0 0 0 1 1
16479 1152921504606846976) returns the obviously-bogus value (-948597
16480 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16481 reports time overflow. See
16482 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16483 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16484 * editfns.c: Include limits.h and intprops.h.
16485 (TIME_T_MIN, TIME_T_MAX): New macros.
16486 (time_overflow): Move earlier, to before first use.
16487 (hi_time, lo_time): New functions, for an accurate test for
16488 out-of-range times.
16489 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16490 (Fget_internal_run_time): Don't assume time_t fits in int.
16491 (make_time): Use list2 instead of Fcons twice.
16492 (Fdecode_time): More accurate test for out-of-range times.
16493 (check_tm_member): New function.
16494 (Fencode_time): Use it, to test for out-of-range times.
16495 (lisp_time_argument): Don't rely on undefined left-shift and
16496 right-shift behavior when checking for time stamp overflow.
16497
16498 * editfns.c (time_overflow): New function, refactoring common code.
16499 (Fformat_time_string, Fdecode_time, Fencode_time):
16500 (Fcurrent_time_string): Use it.
16501
16502 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16503 * dired.c (make_time): Move to ...
16504 * editfns.c (make_time): ... here.
16505 * systime.h: Note the move.
16506
16507 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16508
16509 * fringe.c (update_window_fringes): Remove unused variables.
16510
16511 * unexmacosx.c (copy_data_segment): Also copy __got section.
16512 (Bug#8223)
16513
16514 2011-03-12 Eli Zaretskii <eliz@gnu.org>
16515
16516 * termcap.c [MSDOS]: Include "msdos.h".
16517 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16518 Constify `char *' arguments and their references according to
16519 prototypes in tparam.h.
16520
16521 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
16522
16523 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16524 Adapt all references accordingly.
16525
16526 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16527
16528 2011-03-11 Tom Tromey <tromey@redhat.com>
16529
16530 * buffer.c (syms_of_buffer): Remove obsolete comment.
16531
16532 2011-03-11 Eli Zaretskii <eliz@gnu.org>
16533
16534 * termhooks.h (encode_terminal_code): Declare prototype.
16535
16536 * msdos.c (encode_terminal_code): Don't declare prototype.
16537
16538 * term.c (encode_terminal_code): Now external again, used by
16539 w32console.c and msdos.c.
16540
16541 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16542 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
16543
16544 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
16545
16546 Fix some minor problems found by GCC 4.5.2's static checks.
16547
16548 * fringe.c (update_window_fringes): Mark locals as initialized
16549 (Bug#8227).
16550 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
16551
16552 * alloc.c (mark_fringe_data): Move decl from here ...
16553 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16554 to check its interface.
16555 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16556
16557 * fontset.c (free_realized_fontset): Now static.
16558 (Fset_fontset_font): Rename local to avoid shadowing.
16559 (fontset_font): Mark local as initialized.
16560 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
16561
16562 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16563
16564 * xselect.c (x_disown_buffer_selections): Remove; not used.
16565 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
16566 (x_own_selection, Fx_disown_selection_internal): Rename locals
16567 to avoid shadowing.
16568 (x_handle_dnd_message): Remove local to avoid shadowing.
16569
16570 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16571 so that the caller can use some name other than gcpro1.
16572 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
16573 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16574 (Fx_backspace_delete_keys_p):
16575 Use them to avoid shadowing, and rename vars to avoid shadowing.
16576 (x_decode_color, x_set_name, x_window): Now static.
16577 (Fx_create_frame): Add braces to silence GCC warning.
16578 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
16579 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16580 Remove unused locals.
16581 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16582 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16583 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16584 macros.
16585
16586 * xterm.h (x_mouse_leave): New decl.
16587
16588 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16589 Remove unused functions.
16590 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16591 (x_calc_absolute_position): Now static.
16592 (XTread_socket): Don't define label "out" unless it's used.
16593 Don't declare local "event" unless it's used.
16594 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16595 unless they are used.
16596 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16597 (x_fatal_error_signal): Remove; not used.
16598 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16599 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16600 (x_error_catcher, x_connection_closed, x_error_handler):
16601 (x_error_quitter, xembed_send_message, x_iconify_frame):
16602 (my_log_handler): Rename locals to avoid shadowing.
16603 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
16604 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
16605
16606 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16607 Rename or move locals to avoid shadowing.
16608 (tty_defined_color, merge_face_heights): Now static.
16609 (free_realized_faces_for_fontset): Remove; not used.
16610 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16611 does not deduce is never used uninitialized.
16612 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16613 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
16614
16615 * terminal.c (store_terminal_param): Now static.
16616
16617 * xmenu.c (menu_highlight_callback): Now static.
16618 (set_frame_menubar): Remove unused local.
16619 (xmenu_show): Rename parameter to avoid shadowing.
16620 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16621 since they might point to immutable storage.
16622 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16623 since it's unused otherwise.
16624
16625 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
16626 Add a FIXME, since the code still doesn't look right. (Bug#8215)
16627 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16628 avoids a gcc -Wuninitialized diagnostic.
16629 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
16630 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16631 does not deduce are never used uninitialized.
16632
16633 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16634
16635 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
16636 * window.c (window_loop, size_window):
16637 (run_window_configuration_change_hook, enlarge_window): Likewise.
16638
16639 * window.c (display_buffer): Now static.
16640 (size_window): Mark variables that gcc -Wuninitialized
16641 does not deduce are never used uninitialized.
16642 * window.h (check_all_windows): New decl, to forestall
16643 gcc -Wmissing-prototypes diagnostic.
16644 * dispextern.h (bidi_dump_cached_states): Likewise.
16645
16646 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16647 shadowing.
16648 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
16649 Include <limits.h>.
16650 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16651 and to avoid gcc -Wuninitialized warning.
16652 (load_charset_map): Mark variables that gcc -Wuninitialized
16653 does not deduce are never used uninitialized.
16654 (load_charset): Abort instead of using uninitialized var (Bug#8229).
16655
16656 * coding.c (coding_set_source, coding_set_destination):
16657 Use "else { /* comment */ }" rather than "else /* comment */;"
16658 for clarity, and to avoid gcc -Wempty-body warning.
16659 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16660 a block, when the outer 'i' will do.
16661 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16662 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16663 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16664 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16665 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16666 Rename locals to avoid shadowing.
16667 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
16668 * coding.c (emacs_mule_char, encode_invocation_designation):
16669 Now static, since they're not used elsewhere.
16670 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
16671 (decode_coding_object, encode_coding_object, detect_coding_system):
16672 (decode_coding_emacs_mule): Mark variables that gcc
16673 -Wuninitialized does not deduce are never used uninitialized.
16674 (detect_coding_iso_2022): Initialize a local variable that might
16675 be used uninitialized. Leave a FIXME because it's not clear that
16676 this initialization is needed. (Bug#8211)
16677 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16678 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16679 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16680 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16681 Remove unused macros.
16682
16683 * category.c (hash_get_category_set): Remove unused local var.
16684 (copy_category_table): Now static, since it's not used elsewhere.
16685 * character.c (string_count_byte8): Likewise.
16686
16687 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16688 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16689
16690 * chartab.c (copy_sub_char_table): Now static, since it's not used
16691 elsewhere.
16692 (sub_char_table_ref_and_range, char_table_ref_and_range):
16693 Rename locals to avoid shadowing.
16694 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
16695
16696 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
16697 (BIDI_BOB): Remove unused macro.
16698
16699 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16700 deduce are never used uninitialized.
16701 * term.c (encode_terminal_code): Likewise.
16702
16703 * term.c (encode_terminal_code): Now static. Remove unused local.
16704
16705 * tparam.h: New file.
16706 * term.c, tparam.h: Include it.
16707 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16708 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16709 Move these decls to tparam.h, and make them agree with what
16710 is actually in tparam.c. The previous trick of using incompatible
16711 decls in different modules does not conform to the C standard.
16712 All callers of tparam changed to use tparam's actual API.
16713 * tparam.c (tparam1, tparam, tgoto):
16714 Use const pointers where appropriate.
16715
16716 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16717 * cm.h (struct cm): Likewise.
16718 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16719 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16720 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16721 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16722 (turn_on_face, init_tty): Likewise.
16723 * termchar.h (struct tty_display_info): Likewise.
16724
16725 * term.c (term_mouse_position): Rename local to avoid shadowing.
16726
16727 * alloc.c (mark_ttys): Move decl from here ...
16728 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16729
16730 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16731
16732 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16733
16734 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
16735
16736 * search.c (compile_pattern_1): Remove argument regp, unused since
16737 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16738 (compile_pattern): Don't pass it.
16739
16740 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16741
16742 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16743 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16744 for ! HAVE_GTK3.
16745 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16746
16747 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16748
16749 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16750 gdk_window_get_screen, gdk_window_get_geometry,
16751 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16752 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16753 (xg_get_pixbuf_from_pixmap): New function.
16754 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16755 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16756 Call xg_get_pixbuf_from_pixmap instead of
16757 gdk_pixbuf_get_from_drawable.
16758 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16759 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16760 (xg_check_special_colors): Use GtkStyleContext and its functions
16761 for HAVE_GTK3.
16762 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16763 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16764 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
16765 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16766 Call gtk_widget_get_preferred_size.
16767 (xg_frame_resized): gdk_window_get_geometry only takes 5
16768 parameters.
16769 (xg_win_to_widget, xg_event_is_for_menubar):
16770 Call gdk_x11_window_lookup_for_display.
16771 (xg_set_widget_bg): New function.
16772 (delete_cb): New function.
16773 (xg_create_frame_widgets): Connect delete-event to delete_cb.
16774 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
16775 (xg_set_background_color): Call xg_set_widget_bg.
16776 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16777 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16778 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16779 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16780 if ! HAVE_GTK3.
16781 (update_frame_tool_bar): Call gtk_widget_hide.
16782 (xg_initialize): Use GDK_KEY_g.
16783
16784 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16785 if ! HAVE_GTK3
16786 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16787
16788 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16789 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16790 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16791
16792 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
16793
16794 * w32xfns.c (select_palette): Check success of RealizePalette against
16795 GDI_ERROR, not zero.
16796
16797 See ChangeLog.11 for earlier changes.
16798
16799 ;; Local Variables:
16800 ;; coding: utf-8
16801 ;; End:
16802
16803 Copyright (C) 2011-2012 Free Software Foundation, Inc.
16804
16805 This file is part of GNU Emacs.
16806
16807 GNU Emacs is free software: you can redistribute it and/or modify
16808 it under the terms of the GNU General Public License as published by
16809 the Free Software Foundation, either version 3 of the License, or
16810 (at your option) any later version.
16811
16812 GNU Emacs is distributed in the hope that it will be useful,
16813 but WITHOUT ANY WARRANTY; without even the implied warranty of
16814 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16815 GNU General Public License for more details.
16816
16817 You should have received a copy of the GNU General Public License
16818 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.