1 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3 Remove redundant or unused things here and there.
4 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
5 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6 * editfns.c (Fcompare_buffer_substrings): Likewise.
7 * frame.h (struct terminal, struct font_driver_list):
8 Remove redundant declarations.
9 * window.h (Qleft, Qright): Likewise.
11 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
13 Do not mark objects from deleted buffers, windows and frames.
14 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
15 (mark_object): Likewise for windows and frames.
17 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
19 * alloc.c (valid_lisp_object_p): Treat killed buffers,
20 buffer_defaults and buffer_local_symbols as valid objects.
21 Return special value to denote them.
23 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
25 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
26 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
27 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
28 (file_name_absolute_p, Fsubstitute_in_file_name):
29 (check_executable, check_writable, Ffile_accessible_directory_p)
30 (Fset_file_selinux_context, Fdefault_file_modes)
31 (Finsert_file_contents, choose_write_coding_system)
32 (Fwrite_region, build_annotations, a_write, e_write)
34 * filelock.c (boot_time_initialized, get_boot_time)
35 (get_boot_time_1, lock_file_1, within_one_second):
36 * floatfns.c (in_float):
37 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
38 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
39 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
40 * lisp.h (struct Lisp_Hash_Table.cmpfn):
41 * window.c (compare_window_configurations):
42 Use bool for booleans.
43 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
44 (Fdefault_file_modes): Now mode_t, not int, for modes.
45 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
46 (internal_delete_file): Now returns void, not a (boolean) int,
47 since nobody was looking at the return value.
48 * lisp.h, window.h: Adjust to above API changes.
50 * xdisp.c (set_message): Simplify and reindent last change.
52 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
54 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
56 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
58 * eval.c (call_debugger): Make the function non-static so that we
59 can call it from set_message.
61 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
62 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
64 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
66 Give more-useful info on a fatal error (Bug#12328).
67 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
68 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
69 of doing the work ourselves.
70 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
72 (fatal_error_backtrace): New function, taken from the guts
73 of the old fatal_error_signal, but with a new option to output
75 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
76 info about the signal than just its number.
77 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
78 * sysdep.c: Include <execinfo.h>
79 (emacs_backtrace): New function, taken partly from the previous
80 code of the 'die' function.
81 (emacs_abort): Call fatal_error_backtrace rather than abort.
83 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
85 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
86 eager (load-time) macro-expansion.
87 * lisp.mk (lisp): Add macroexp.
89 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
91 Simplify redefinition of 'abort' (Bug#12316).
92 Do not try to redefine the 'abort' function. Instead, redo
93 the code so that it calls 'emacs_abort' rather than 'abort'.
94 This removes the need for the NO_ABORT configure-time macro
95 and makes it easier to change the abort code to do a backtrace.
96 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
97 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
98 Remove; sysdep.c's emacs_abort now takes its place.
99 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
100 'abort' changed to use 'emacs_abort'.
101 * msdos.c (dos_abort) [defined abort]: Remove; not used.
102 (abort) [!defined abort]: Rename to ...
103 (emacs_abort): ... new name.
104 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
105 the place of the old 'abort' in emacs.c.
106 * w32.c, w32fns.c (abort): Do not #undef.
107 * w32.c (emacs_abort): Rename from w32_abort.
109 2012-09-04 Eli Zaretskii <eliz@gnu.org>
111 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
112 offsets[j].dv, since the y axis of the screen coordinates points
113 down, while the y axis of the font definition coordinates points
114 up. This fixes display of Arabic diacritics such as KASRA and
115 KASRATAN. (Bug#11860)
117 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
119 Be more systematic about _setjmp vs setjmp.
120 * alloc.c (test_setjmp, mark_stack):
121 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
122 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
123 (png_load, my_error_exit, jpeg_load):
124 * process.c (send_process_trap, send_process):
125 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
126 The underscored versions are up to 30x faster on some hosts.
127 Formerly, the code used setjmp+longjmp sometimes and
128 _setjmp+_longjmp at other times, with no particular reason to
129 prefer setjmp+longjmp.
131 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
133 Fix minor problem found by static checking.
134 * buffer.c (Fdelete_all_overlays): Return nil.
136 2012-09-03 Martin Rudalics <rudalics@gmx.at>
138 * buffer.c (Fdelete_all_overlays): New function.
140 2012-09-03 Chong Yidong <cyd@gnu.org>
142 * gtkutil.c: Add extern decl for Qxft.
144 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
146 * emacs.c, eval.c: Use bool for boolean.
147 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
148 (malloc_using_checking) [DOUG_LEA_MALLOC]:
149 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
150 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
151 (main, decode_env_path, Fdaemon_initialized):
152 * eval.c (call_debugger, Finteractive_p, interactive_p):
153 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
154 (maybe_call_debugger, Fbacktrace):
155 * process.c (read_process_output, exec_sentinel):
156 Use bool for booleans.
157 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
159 * eval.c (interactive_p): Omit always-true boolean argument
160 EXCLUDE_SUBRS_P. All callers changed.
161 * dispextern.h, lisp.h: Reflect above API changes.
162 * firstfile.c (dummy): Use the address of 'main', whose signature
163 won't change, instead of the address of 'initialize', whose
164 signature just changed from int to bool.
165 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
166 * msdos.c (fatal_error_in_progress): ... from here.
167 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
169 (redisplay_internal, unwind_redisplay): Simply clear
170 REDISPLAYING_P when unwinding, instead of saving its previous,
171 always-false value and then restoring it.
173 Clean up some extern decls.
174 Mostly, this hoists extern decls out of .c files and into .h files.
175 That way, we're more likely to catch errors if the interfaces change.
176 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
177 declare xg_mark_data.
178 * dispextern.h (x_frame_parm_handlers):
180 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
181 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
182 (Qultra_bold, Qoblique, Qitalic):
183 Move extern decl here from .c file.
184 * alloc.c (xg_mark_data) [USE_GTK]:
186 * eval.c (Qlexical_binding):
187 * fns.c (time) [!HAVE_UNISTD_H]:
188 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
189 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
190 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
191 * lread.c (Qinternal_interpreter_environment):
192 * minibuf.c (Qbuffer):
193 * process.c (QCfamily, QCfilter):
194 * widget.c (free_frame_faces):
195 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
196 * xfont.c (x_clear_errors):
197 * xterm.c (x_frame_parm_handlers):
198 Remove now-redundant extern decls.
199 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
200 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
202 * xfaces.c: Remove unnecessary static decls.
203 * xterm.c (updating_frame): Remove decl of nonexistent object.
205 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
206 when building globals.h, as the objects that are not built on
207 this host are not needed to compile C files on this host.
209 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
211 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
213 * frame.h: Add missing prototype for x_wm_set_size_hint.
215 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
217 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
218 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
219 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
220 (Fsubstitute_command_keys):
221 * editfns.c (region_limit, find_field, Fconstrain_to_field)
222 (save_excursion_save, save_excursion_restore)
223 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
224 (format_time_string, general_insert_function)
225 (make_buffer_string, make_buffer_string_both)
226 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
227 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
228 (copy_text, insert_1, insert_1_both, insert_from_string)
229 (insert_from_string_before_markers, insert_from_string_1)
230 (insert_from_buffer, insert_from_buffer_1, replace_range)
231 (replace_range_2, del_range_1, del_range_byte, del_range_both)
232 (del_range_2, modify_region):
233 * intervals.c (intervals_equal, balance_possible_root_interval)
234 (adjust_intervals_for_insertion, merge_properties_sticky)
235 (graft_intervals_into_buffer, lookup_char_property)
236 (adjust_for_invis_intang, set_point_both)
237 (get_property_and_range, compare_string_intervals)
238 (set_intervals_multibyte_1, set_intervals_multibyte):
239 * keyboard.c (decode_timer):
240 Use bool for boolean.
241 * intervals.h, lisp.h, systime.h: Reflect above API changes.
242 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
244 2012-09-02 Chong Yidong <cyd@gnu.org>
246 * keymap.c (push_key_description): Print M-TAB as C-M-i
249 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
251 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
252 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
253 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
254 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
255 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
256 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
257 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
259 2012-09-01 Eli Zaretskii <eliz@gnu.org>
261 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
262 more than one grapheme cluster passed to the shaper: compute the
263 offset adjustment values separately for each cluster. (Bug#11860)
265 * image.c: Restore mistakenly removed inclusion of w32.h. Without
266 it, GCC doesn't see prototypes of w32_delayed_load, and complains
267 about implicit conversions from integer to pointer.
269 2012-09-01 Daniel Colascione <dancol@dancol.org>
271 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
272 system used too early.
274 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
276 Better seed support for (random).
277 * emacs.c (main): Call init_random.
278 * fns.c (Frandom): Set the seed from a string argument, if given.
279 Remove long-obsolete Gentzel cruft.
280 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
281 (init_random): New function.
283 2012-09-01 Daniel Colascione <dancol@dancol.org>
285 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
286 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
287 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
288 x_wm_set_size_hint, x_query_colors, x_real_positions,
289 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
290 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
291 all of which have been moved to common code.
293 * xfaces.c: Include TERM_HEADER instead of listing all possible
294 window-system headers.
296 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
299 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
300 directly accessing frame internals.
302 * w32font.h: Include font.h. Define syms_of_w32font and
305 * process.c: Include TERM_HEADER instead of listing all possible
306 window-system headers.
308 * nsterm.h: Remove declarations now in frame.h. Define
309 FRAME_X_SCREEN, FRAME_X_VISUAL.
311 * menu.c: Include TERM_HEADER instead of listing all possible
312 window-system headers.
314 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
317 * keyboard.c: Include TERM_HEADER instead of listing all possible
318 window-system headers.
320 * image.c: Include TERM_HEADER instead of listing all possible
321 window-system headers. Declare Vlibrary_cache when compiling for
324 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
325 window system declarations.
327 * frame.h: Move common functions here: set_frame_menubar,
328 x_set_window_size, x_sync, x_get_focus_frame,
329 x_set_mouse_position, x_set_mouse_pixel_position,
330 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
331 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
332 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
333 x_activate_menubar, x_real_positions, x_bitmap_icon,
334 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
337 * frame.c: Include TERM_HEADER instead of listing all possible
338 window-system headers.
340 * font.c: Include TERM_HEADER instead of listing all possible
341 window-system headers.
343 * emacs.c: Include TERM_HEADER.
345 * dispnew.c: Include TERM_HEADER instead of listing all possible
346 window-system headers.
348 * ccl.h: Include character.h.
350 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
351 the current window system; include in list of objects to link into
354 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
356 Remove mark_ttys function and fix tty_display_info initialization.
357 * lisp.h (mark_ttys): Remove prototype.
358 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
359 to mark_ttys because all possible values of 'top_frame' slot are
360 the frames which are reachable from Vframe_list.
361 * term.c (mark_ttys): Remove.
362 (init_tty): Safely initialize 'top_frame' slot with Qnil.
364 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
366 Change struct frame bitfields from unsigned char to unsigned.
367 * frame.h (struct frame): Change type of 'display_preempted',
368 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
369 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
370 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
371 bitfields from unsigned char to unsigned.
373 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
375 Remove unused member of struct x_output and struct w32_output.
376 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
377 * w32term.h (struct w32_output): Likewise.
379 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
381 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
382 does not become zero (Bug#12234).
384 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
386 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
387 for GCC 4.7.1 x86-64.
389 2012-08-30 Glenn Morris <rgm@gnu.org>
391 * lread.c (init_lread): For out-of-tree builds, only add the
392 source directory's site-lisp dir to the load-path if it exists,
393 consistent with in-tree builds. (Bug#12302)
395 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
397 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
398 button_values to NULL. Call setStykeMask so dialogs get a close button.
399 (windowShouldClose:): Set window_closed.
400 (dealloc): New member, free button_values.
401 (process_dialog:): Make member function. Remove window argument,
402 replace window with self. Count buttons and allocate and store values
404 (addButton:value:row:): value is int with the name tag. Call setTag
405 with tag. Remove return self, declare return value as void.
406 (addString:row:): Remove return self, declare return value as void.
407 (addSplit): Remove return self, declare return value as void.
408 (clicked:): Remove return self, declare return value as void.
409 Set dialog_return to button_values[seltag]. Code formatting change.
410 (initFromContents:isQuestion:): Adjust call to process_dialog.
411 Code formatting change.
412 (timeout_handler:): Set timer_fired to YES.
413 (runDialogAt:): Set timer_fired to NO.
414 Handle click on close button as quit.
416 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
417 Add window_closed and button_values. Add void as return value for
418 add(Button|String|Split). addButton takes int instead of Lisp_Object.
419 Add process_dialog as new member.
421 2012-08-28 Eli Zaretskii <eliz@gnu.org>
423 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
424 is not one of the heaps we manage. (Bug#12242)
426 2012-08-28 Glenn Morris <rgm@gnu.org>
428 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
430 2012-08-28 Martin Rudalics <rudalics@gmx.at>
432 * window.c (Fset_window_configuration): Remove handling of
433 auto-buffer-name window parameter. Install revision of reverted
436 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
438 Do not allow to set major mode for a dead buffer.
439 * buffer.c (Fset_buffer_major_mode): Signal an error
440 if the buffer is dead.
441 (Fother_buffer, other_buffer_safely): Remove redundant
444 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
446 Always use set_buffer_if_live to restore original buffer at unwind.
447 * buffer.h (record_unwind_current_buffer): New function.
448 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
449 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
450 * undo.c, window.c: Adjust users.
451 * buffer.c (set_buffer_if_live): Fix comment.
453 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
455 Fix usage of set_buffer_internal.
456 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
457 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
458 * coding.c (decode_coding): Omit redundant test.
459 * fileio.c (decide_coding_unwind): Likewise.
460 * fns.c (secure_hash): Likewise.
461 * insdel.c (modify_region): Likewise.
462 * keyboard.c (command_loop_1): Likewise.
463 * print.c (PRINTFINISH): Likewise.
464 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
466 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
468 * dispnew.c: Use bool for boolean.
469 (frame_garbaged, display_completed, delayed_size_change)
470 (fonts_changed_p, add_window_display_history)
471 (add_frame_display_history, verify_row_hash)
472 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
473 (row_equal_p, realloc_glyph_pool)
474 (allocate_matrices_for_frame_redisplay)
475 (showing_window_margins_p)
476 (adjust_frame_glyphs_for_frame_redisplay)
477 (build_frame_matrix_from_leaf_window, make_current)
478 (mirrored_line_dance, mirror_line_dance, update_frame)
479 (update_window_tree, update_single_window)
480 (check_current_matrix_flags, update_window, update_text_area)
481 (update_window_line, set_window_update_flags, scrolling_window)
482 (update_frame_1, scrolling, buffer_posn_from_coords)
483 (do_pending_window_change, change_frame_size)
484 (change_frame_size_1, sit_for):
485 Use bool for boolean.
486 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
487 and remove last int (actually boolean) argument, which was always 0.
489 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
490 * dispextern.h (struct composition_it): Use bool for boolean.
491 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
492 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
493 * dired.c (file_name_completion):
494 Use bool for boolean. (This was missed in an earlier change.)
496 2012-08-27 Martin Rudalics <rudalics@gmx.at>
498 * window.c (Fset_window_configuration): Revert first part of
501 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
503 * nsterm.h (NSPanel): New class variable dialog_return.
505 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
507 (windowShouldClose:): Use stop instead of stopModalWithCode.
508 (clicked:): Ditto, and also set dialog_return (Bug#12258).
509 (timeout_handler:): Use stop instead of abortModal. Send a dummy
511 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
514 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
516 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
517 * composite.c (find_composition, composition_gstring_p)
518 (composition_reseat_it, find_automatic_composition):
519 * data.c (let_shadows_buffer_binding_p)
520 (let_shadows_global_binding_p, set_internal, make_blv)
521 (Fmake_variable_buffer_local, Fmake_local_variable)
522 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
523 (cons_to_signed, arith_driver):
524 * dbusbind.c (xd_in_read_queued_messages):
525 * dired.c (directory_files_internal, file_name_completion):
526 Use bool for booleans.
527 * dired.c (file_name_completion):
528 * process.h (fd_callback):
529 Omit int (actually boolean) argument. It wasn't being used.
531 * composite.h, lisp.h: Reflect above API changes.
533 * cmds.c, coding.c: Use bool for booleans.
534 * cmds.c (move_point, Fself_insert_command):
535 * coding.h (struct composition status, struct coding_system):
536 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
537 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
538 (emacs_mule_char, decode_coding_emacs_mule)
539 (encode_coding_emacs_mule, detect_coding_iso_2022)
540 (decode_coding_iso_2022, encode_invocation_designation)
541 (encode_designation_at_bol, encode_coding_iso_2022)
542 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
543 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
544 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
545 (encode_coding_raw_text, detect_coding_charset)
546 (decode_coding_charset, encode_coding_charset, detect_eol)
547 (detect_coding, get_translation_table, produce_chars)
548 (consume_chars, reused_workbuf_in_use)
549 (make_conversion_work_buffer, code_conversion_save)
550 (decode_coding_object, encode_coding_object)
551 (detect_coding_system, char_encodable_p)
552 (Funencodable_char_position, code_convert_region)
553 (code_convert_string, code_convert_string_norecord)
554 (Fset_coding_system_priority):
555 * fileio.c (Finsert_file_contents):
556 Use bool for booleans.
557 * coding.h, lisp.h: Reflect above API changes.
558 * coding.c: Remove unnecessary static function decls.
559 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
560 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
561 not a boolean 'int', since callers never look at the return value.
562 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
563 * coding.h (decoding_buffer_size, encoding_buffer_size)
564 (emacs_mule_string_char): Remove unused extern decls.
565 (struct iso_2022_spec, struct coding_system):
566 Use 'unsigned int : 1' for boolean fields, since there's more than one.
567 (struct emacs_mule_spec): Remove unused field 'full_support'.
568 All initializations removed.
569 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
571 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
573 Fix spare memory change (Bug#12286).
574 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
575 (valid_lisp_object_p): Likewise.
577 2012-08-27 Martin Rudalics <rudalics@gmx.at>
579 * window.c (Fset_window_configuration): Record any window's old
580 buffer if it's replaced (see Bug#8789). If the new current
581 buffer doesn't appear in the selected window, go to its old
584 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
586 Special MEM_TYPE_SPARE to denote reserved memory.
587 * alloc.c (enum mem_type): New memory type.
588 (refill_memory_reserve): Use new type for spare memory.
589 This prevents live_cons_p and live_string_p from incorrect
590 detection of uninitialized objects from spare memory as live.
592 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
595 * Makefile.in (.PHONY): versioclean -> versionclean.
597 Remove unused external symbols.
598 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
599 * window.c (Qwindow_valid_p, decode_valid_window):
600 Now static, not extern.
601 * data.c (Qinterval): Remove; unused.
602 (syms_of_data): Do not define 'interval'.
603 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
604 * window.h (decode_valid_window):
607 * character.c, charset.c, chartab.c: Use bool for booleans.
608 * character.c (lisp_string_width, string_count_byte8)
609 (string_escape_byte8):
610 * charset.c (charset_map_loaded, load_charset_map, read_hex):
611 (load_charset_map_from_file, map_charset_chars)
612 (Fdefine_charset_internal, define_charset_internal)
613 (Fdeclare_equiv_charset, find_charsets_in_text)
614 (Ffind_charset_region, char_charset, Fiso_charset):
615 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
616 (sub_char_table_set, sub_char_table_set_range)
617 (char_table_set_range, optimize_sub_char_table)
618 (map_sub_char_table):
619 Use bool for boolean.
620 * character.c (str_to_unibyte): Omit last boolean argument; it was
621 always 0. All callers changed.
622 * character.h, charset.h: Adjust to match previous changes.
623 * character.h (char_printable_p): Remove decl of nonexistent function.
624 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
625 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
626 are all boolean, so make them single-bit bitfields.
628 * lisp.h (ASET): Remove attempt to detect side effects.
629 It was meant to be temporary and it often doesn't work,
630 because when IDX has side effects the behavior of IDX==IDX
631 is undefined. See Stefan Monnier in
632 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
634 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
636 * lisp.h (functionp): New function (extracted from Ffunctionp).
638 * eval.c (Ffunctionp): Use it.
640 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
642 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
643 as that's faster and simpler than static storage. Don't bother
644 with the g_main_context_query overhead if g_main_context_pending
645 says no events are pending.
646 (gfds, gfds_size): Remove these static vars.
647 (xgselect_initialize): Remove; no longer needed.
648 All uses and decls removed.
650 * emacs.c (fatal_error_signal_hook): Remove.
651 All uses removed. This leftover from old code was always 0.
653 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
654 * casefiddle.c (casify_object, casify_region):
655 * casetab.c (set_case_table):
656 * category.c, category.h (word_boundary_p):
657 * category.h (CHAR_HAS_CATEGORY):
658 Use bool for booleans, instead of int.
660 2012-08-25 Eli Zaretskii <eliz@gnu.org>
662 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
664 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
666 On assertion failure, print backtrace if available.
667 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
668 (die) [ENABLE_CHECKING]: Print a backtrace if available.
669 * Makefile.in (LIB_EXECINFO): New macro.
672 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
673 * bytecode.c (exec_byte_code):
674 * callint.c (check_mark, Fcall_interactively):
675 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
676 (getenv_internal, sync_process_alive, call_process_exited):
677 * lisp.h (USE_SAFE_ALLOCA):
678 Use bool for booleans, instead of int.
679 * lisp.h, process.h: Adjust prototypes to match above changes.
680 * callint.c (Fcall_interactively): Don't assume the mark's
681 offset fits in 'int'.
683 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
685 * buffer.c, buffer.h: Use bool for boolean.
686 * buffer.c (reset_buffer_local_variables)
687 (buffer_lisp_local_variables, Fset_buffer_modified_p)
688 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
689 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
690 (overlay_touches_p, overlay_strings, Foverlay_put)
691 (report_overlay_modification, call_overlay_mod_hooks):
692 (mmap_enlarge, mmap_set_vars):
693 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
694 Use bool for booleans, instead of int.
695 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
696 since the 1-or-0 return value is always ignored anyway.
697 (mmap_initialized_p):
698 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
699 * buffer.h, lisp.h: Adjust prototypes to match above changes.
701 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
703 * bidi.c: Use bool for boolean.
704 This is a bit more readable, and makes the text segment of bidi.o
705 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
706 Presumably it's faster too.
707 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
709 (bidi_cache_find_level_change, bidi_cache_iterator_state)
710 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
711 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
712 (bidi_explicit_dir_char, bidi_level_of_next_char)
713 (bidi_find_other_level_edge, bidi_move_to_visually_next):
714 Use bool for booleans, instead of int.
715 * dispextern.h (bidi_init_it, bidi_paragraph_init)
716 (bidi_unshelve_cache): Adjust decls to match code.
718 2012-08-23 Martin Rudalics <rudalics@gmx.at>
720 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
723 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
725 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
726 * atimer.h: Include <stdbool.h>.
728 2012-08-22 Dan Nicolaescu <dann@gnu.org>
730 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
731 compile time tests instead of run time tests on systems that do
733 (FRAME_MAC_P): Remove leftover from deleted code.
734 * frame.c (syms_of_frame): Remove leftover from deleted code.
736 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
738 * nsterm.m (insertText:): Don't clear modifiers if code is space.
740 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
742 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
743 Otherwise, the compiler complains about (A?B:C) where B is void
744 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
745 (fontset_add): Return void, for FONTSET_ADD.
747 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
749 * alloc.c: Use bool for booleans.
750 (gc_in_progress, abort_on_gc)
751 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
752 (dont_register_blocks) [GC_MALLOC_CHECK]:
753 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
754 (check_string_bytes, make_specified_string, memory_full)
755 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
756 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
757 (mark_stack, valid_pointer_p, make_pure_string)
758 (Fgarbage_collect, survives_gc_p, gc_sweep):
759 Use bool for booleans, instead of int.
760 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
762 * alloc.c (PURE_POINTER_P):
763 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
764 * editfns.c (Fformat):
765 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
767 * fns.c (sweep_weak_table):
768 * lisp.h (suppress_checking, push_message, survives_gc_p)
769 (make_pure_string, gc_in_progress, abort_on_gc):
770 * lread.c (readchar, read1):
771 * print.c (Fprin1_to_string):
772 * xdisp.c (push_message):
773 Use bool for booleans affected directly or indirectly by
776 Make recently-introduced setters macros.
777 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
778 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
779 (set_fontset_default, set_fontset_fallback): Rename from their
780 upper-case counterparts, and make them functions rather than macros.
781 This is more consistent with the other recently-introduced setters.
782 These don't need to be inline, since they're local.
784 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
786 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
787 the loop (Bug#12247).
789 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
791 * lisp.h (vcopy): Use memcpy rather than our own loop.
792 This fixes a performance regression introduced by the recent
793 addition of vcopy. This means 'vcopy' will need to be modified
794 for a copying collector, but that's OK. Also, tighten the
795 checking in the assertion.
797 2012-08-21 Eli Zaretskii <eliz@gnu.org>
799 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
800 components for RTL text (Bug#11860). Adjust X-OFFSET of each
801 non-base glyph for the width of the base character, according to
802 what x_draw_composite_glyph_string_foreground expects.
803 Generate WADJUST value according to composition_gstring_width's
804 expectations, to produce correct width of the composed character.
805 Reverse the sign of the DU offset produced by ScriptPlace.
807 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
809 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
811 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
813 Avoid direct writes to contents member of struct Lisp_Vector.
814 * lisp.h (vcopy): New function to copy data into vector.
815 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
816 * fns.c (Ffillarray): Use ASET.
817 * keyboard.c (timer_check_2): Use AREF and ASET.
818 (append_tool_bar_item, Frecent_keys): Use vcopy.
819 * lread.c (read_vector): Use ASET.
820 * msdos.c (Frecent_doskeys): Use vcopy.
821 * xface.c (Finternal_copy_lisp_face): Use vcopy.
822 (Finternal_merge_in_global_face): Use ASET and vcopy.
823 * xfont.c (xfont_list_pattern): Likewise.
825 2012-08-21 Martin Rudalics <rudalics@gmx.at>
827 * window.c (Fwindow_point): For the selected window always return
828 the position of its buffer's point.
829 (Fset_window_point): For the selected window always go in its
830 buffer to the specified position.
832 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
834 Setter macros for fontsets.
835 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
836 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
837 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
840 2012-08-20 Glenn Morris <rgm@gnu.org>
842 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
843 Don't assume that `ln -f' works.
845 2012-08-20 Eli Zaretskii <eliz@gnu.org>
847 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
848 and later about non-assignments with no effect. See discussion at
849 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
852 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
854 Inline setter functions for Lisp_Objects slots of struct specbinding.
855 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
858 2012-08-20 Martin Rudalics <rudalics@gmx.at>
860 * window.c (select_window): Always make selected window's buffer
863 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
865 Use AREF and ASET for docstrings of category tables.
866 * category.h (CATEGORY_DOCSTRING): Use AREF.
867 (SET_CATEGORY_DOCSTRING): Use ASET.
868 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
870 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
872 Inline setter functions for hash table members.
873 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
874 (set_hash_hash, set_hash_index): Rename with _slot suffix.
875 (set_hash_key_and_value, set_hash_index, set_hash_next)
876 (set_hash_hash): New functions.
877 * charset.c, fns.c: Adjust users.
879 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
881 Inline getter and setter functions for per-buffer values.
882 * buffer.h (per_buffer_default, set_per_buffer_default)
883 (per_buffer_value, set_per_buffer_value): New functions.
884 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
885 * buffer.c, data.c: Adjust users.
887 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
889 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
891 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
893 Rely on <config.h> + <unistd.h> to declare 'environ',
894 as gnulib does this if the system doesn't.
895 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
896 Remove declaration. MS-Windows declares it on stdlib.h which is
897 included by conf_post.h.
898 * emacs.c (environ) [DOUG_LEA_MALLOC]:
899 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
900 * vm-limit.c: Include <unistd.h>, for 'environ'.
902 * unexaix.c, unexcoff.c: Include "mem-limits.h".
903 (start_of_data): Remove decl; mem-limits.h provides it.
905 * xdisp.c (handle_invisible_prop): Make it a bit faster
906 and avoid a gcc -Wmaybe-uninitialized diagnostic.
908 2012-08-19 Chong Yidong <cyd@gnu.org>
910 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
913 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
915 * .gdbinit: Use call instead of set when calling a function in the
918 * data.c (set_internal): Don't use set_blv_found.
919 (Fkill_local_variable): Likewise.
921 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
923 * nsfont.m (ns_ascii_average_width): Ensure the string
924 ascii_printable is initialized with a null-terminated character
925 array. Otherwise, it can contain undesired extra characters.
927 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
929 port new setting code to Sun C 5.8 2005/10/13
930 * chartab.c, lisp.h (char_table_set, char_table_set_range):
931 Return void, not Lisp_Object. Otherwise, the compiler
932 complains about (A?B:C) where B is void and C is Lisp_Object
933 when compiling CHAR_TABLE_SET, due to the recent change to
934 the API of sub_char_table_set_contents.
936 2012-08-18 Chong Yidong <cyd@gnu.org>
938 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
939 for the string case (Bug#3874).
941 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
943 * buffer.h (BSET): Remove (Bug#12215).
944 Replace all uses with calls to new setter functions.
945 (bset_bidi_paragraph_direction, bset_case_canon_table)
946 (bset_case_eqv_table, bset_directory, bset_display_count)
947 (bset_display_time, bset_downcase_table)
948 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
949 (bset_last_selected_window, bset_local_var_alist)
950 (bset_mark_active, bset_point_before_scroll, bset_read_only)
951 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
953 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
954 (bset_auto_fill_function, bset_auto_save_file_format)
955 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
956 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
957 (bset_cache_long_line_scans, bset_case_fold_search)
958 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
959 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
960 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
961 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
962 (bset_header_line_format, bset_indicate_buffer_boundaries)
963 (bset_indicate_empty_lines, bset_invisibility_spec)
964 (bset_left_fringe_width, bset_major_mode, bset_mark)
965 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
966 (bset_name, bset_overwrite_mode, bset_pt_marker)
967 (bset_right_fringe_width, bset_save_length)
968 (bset_scroll_bar_width, bset_scroll_down_aggressively)
969 (bset_scroll_up_aggressively, bset_selective_display)
970 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
971 (bset_word_wrap, bset_zv_marker):
972 * category.c (bset_category_table):
973 * syntax.c (bset_syntax_table):
974 New setter functions.
976 * process.h (PSET): Remove (Bug#12215).
977 Replace all uses with calls to new setter functions.
978 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
979 (PROCESS_INLINE): New macro.
980 (pset_childp): New setter function.
981 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
982 * process.c (PROCESS_INLINE):
983 Define to EXTERN_INLINE, so that the corresponding functions
984 are compiled into code.
985 (pset_buffer, pset_command, pset_decode_coding_system)
986 (pset_decoding_buf, pset_encode_coding_system)
987 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
988 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
989 (pset_type, pset_write_queue): New setter functions.
991 * window.h (WSET): Remove (Bug#12215).
992 Replace all uses with calls to new setter functions.
993 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
994 (WINDOW_INLINE): New macro.
995 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
996 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
997 (wset_total_lines, wset_vertical_scroll_bar)
998 (wset_window_end_pos, wset_window_end_valid)
999 (wset_window_end_vpos): New setter functions.
1000 * window.c (WINDOW_INLINE):
1001 Define to EXTERN_INLINE, so that the corresponding functions
1002 are compiled into code.
1003 (wset_combination_limit, wset_dedicated, wset_display_table)
1004 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1005 (wset_new_normal, wset_new_total, wset_next_buffers)
1006 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1007 (wset_prev_buffers, wset_right_fringe_width)
1008 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1009 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1010 (wset_window_parameters):
1011 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1012 (wset_column_number_displayed, wset_region_showing):
1013 New setter functions.
1015 * termhooks.h (TSET): Remove (Bug#12215).
1016 Replace all uses with calls to new setter functions.
1017 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1018 (TERMHOOKS_INLINE): New macro.
1019 (tset_charset_list, tset_selection_alist): New setter functions.
1020 * terminal.c (TERMHOOKS_INLINE):
1021 Define to EXTERN_INLINE, so that the corresponding functions
1022 are compiled into code.
1023 (tset_param_alist): New setter function.
1025 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1027 * keyboard.h (KSET): Remove (Bug#12215).
1028 Replace all uses with calls to new setter functions.
1029 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1030 (KEYBOARD_INLINE): New macro.
1031 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1032 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1033 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1034 New setter functions.
1035 * keyboard.c (KEYBOARD_INLINE):
1036 Define to EXTERN_INLINE, so that the corresponding functions
1037 are compiled into code.
1038 (kset_echo_string, kset_kbd_queue)
1039 (kset_keyboard_translate_table, kset_last_prefix_arg)
1040 (kset_last_repeatable_command, kset_local_function_key_map)
1041 (kset_overriding_terminal_local_map, kset_real_last_command)
1042 (kset_system_key_syms): New setter functions.
1044 * frame.h (FSET): Remove (Bug#12215).
1045 Replace all uses with calls to new setter functions.
1046 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1047 (FRAME_INLINE): New macro.
1048 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1049 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1050 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1051 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1052 (fset_param_alist, fset_root_window, fset_scroll_bars)
1053 (fset_selected_window, fset_title, fset_tool_bar_items)
1054 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1055 * frame.c (FRAME_INLINE):
1056 Define to EXTERN_INLINE, so that the corresponding functions
1057 are compiled into code.
1058 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1060 A few more naming-convention fixes for getters and setters.
1061 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1062 and rename from buffer_overlays_set_before.
1063 (set_buffer_overlays_after): Move here from buffer.h, and rename
1064 from buffer_overlays_set_after.
1065 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1067 (set_buffer_intervals): Rename from buffer_set_intervals.
1068 * intervals.c (set_interval_object): Move here from intervals.h,
1069 and rename from interval_set_object.
1070 (set_interval_left): Move here from intervals.h, and rename from
1072 (set_interval_right): Move here from intervals.h, and rename from
1074 (copy_interval_parent): Move here from intervals.h, and rename from
1075 interval_copy_parent.
1076 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1077 (set_interval_plist): Rename from interval_set_plist.
1078 Return void, not Lisp_Object, since no caller uses the result.
1079 * lisp.h (string_intervals): Rename from string_get_intervals.
1080 (set_string_intervals): Rename from string_set_intervals.
1082 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1083 (set_char_table_contents): Rename from char_table_set_contents.
1084 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1085 All uses changed. See the end of
1086 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1088 * lisp.h (CSET): Remove (Bug#12215).
1089 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1090 (set_char_table_purpose): New functions,
1091 replacing CSET. All uses changed. For example, replace
1092 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1093 "set_char_table_parent (char_table, parent);".
1094 The old version was confusing because it used the same name
1095 'parent' for two different things.
1097 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1099 Functions to get and set Lisp_Object fields of buffer-local variables.
1100 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1101 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1102 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1103 * data.c, eval.c, frame.c: Adjust users.
1105 2012-08-17 Chong Yidong <cyd@gnu.org>
1107 * xfaces.c (merge_face_vectors): If the target font specfies a
1108 font spec, make the font's attributes take precedence over
1109 directly-specified attributes.
1110 (merge_face_ref): Recognize :font.
1112 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1114 Do not use memcpy for copying intervals.
1115 * intervals.c (reproduce_interval): New function.
1116 (reproduce_tree, reproduce_tree_obj): Use it.
1117 (reproduce_tree_obj): Remove prototype.
1119 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1121 * lisp.h (duration_to_sec_usec): Remove unused decl.
1123 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1125 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1126 to an allocated instance of NSString, not to the class itself.
1128 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1130 * makefile.w32-in (C_CTYPE_H): New macro.
1131 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1132 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1133 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1135 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1137 Use ASCII tests for character types.
1138 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1140 Don't include <ctype.h>; was not needed.
1141 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1142 * sysdep.c, xfaces.c:
1143 Include <c-ctype.h> instead of <ctype.h>.
1144 * nsterm.m: Include <c-ctype.h>.
1145 * charset.c (read_hex):
1146 * doc.c (Fsnarf_documentation):
1147 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1148 (DRIVE_LETTER) [DOS_NT]:
1149 (Ffile_name_directory, Fexpand_file_name)
1150 (Fsubstitute_in_file_name):
1151 * font.c (font_parse_xlfd, font_parse_fcname):
1152 * frame.c (x_set_font_backend):
1153 * gtkutil.c (xg_get_font):
1154 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1155 * nsimage.m (hexchar):
1156 * nsterm.m (ns_xlfd_to_fontname):
1157 * sysdep.c (system_process_attributes):
1158 * xfaces.c (hash_string_case_insensitive):
1159 Use C-locale tests instead of locale-specific tests for character
1160 types, since we want the ASCII interpretation here, not the
1161 interpretation suitable for whatever happens to be the current locale.
1163 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1165 Consistently check windows for validity/liveness
1166 (Bug#11984, Bug#12025, Bug#12026).
1167 * lisp.h (CHECK_VALID_WINDOW): New macro.
1168 * window.c (decode_window): Rename to decode_live_window.
1169 (decode_valid_window, Fwindow_valid_p): New functions.
1170 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1171 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1172 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1173 (Fwindow_prev_sibling, Fwindow_combination_limit)
1174 (Fset_window_combination_limit, Fwindow_use_time)
1175 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1176 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1177 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1178 (Fwindow_hscroll, Fset_window_hscroll)
1179 (Fwindow_redisplay_end_trigger)
1180 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1181 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1182 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1183 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1184 (Fwindow_end, Fset_window_point, Fset_window_start)
1185 (Fpos_visible_in_window_p, Fwindow_line_height)
1186 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1187 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1188 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1189 (Fset_window_parameter, Fwindow_display_table)
1190 (Fset_window_display_table, Fdelete_other_windows_internal)
1191 (Fset_window_buffer, Fset_window_new_total)
1192 (Fset_window_new_normal, Fdelete_window_internal)
1193 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1194 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1195 (Fwindow_scroll_bars): Check whether argument window is a valid or
1196 live window. Update doc-strings.
1197 (syms_of_window): New symbol Qwindow_valid_p.
1198 * keyboard.c (Fposn_at_x_y): Check whether argument
1199 frame_or_window denotes a valid window.
1201 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1203 Fix previous char table change.
1204 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1205 * chartab.c (optimize_sub_char_table): Likewise.
1207 2012-08-16 Chong Yidong <cyd@gnu.org>
1209 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1211 * xfont.c (xfont_open):
1212 * xftfont.c (xftfont_open): Set the font's max_width field.
1214 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1215 min_width to space_width and average_width to the average over
1216 printable ASCII characters.
1217 (ns_char_width): Code cleanup.
1218 (ns_ascii_average_width): New utility function.
1220 * font.h (struct font): Update comments.
1222 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1224 Simple interface to set Lisp_Object fields of character tables.
1225 * lisp.h (CSET): New macro.
1226 (char_table_set_extras, char_table_set_contents)
1227 (sub_char_table_set_contents): New function.
1228 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1229 * syntax.c: Adjust users.
1231 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1233 * eval.c (eval_sub): Bind lexical-binding.
1234 * lread.c (Qlexical_binding): Make non-static.
1236 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1238 * nsmenu.m (popupSession): Remove.
1239 (pop_down_menu): Remove endModalSession.
1240 (timeout_handler:): New method.
1241 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1242 Call runModalForWindow. Check timer_fired when it returns.
1243 If not set, cancel timer and break out of loop.
1244 Otherwise loop again, with a new timeout.
1246 * nsterm.m: Include fcntl.h if present.
1247 (fd_entry, t_readfds, inNsSelect): Remove.
1248 (select_writefds, select_valid, select_timeout, selfds)
1249 (select_mutex, apploopnr): Add.
1250 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1251 Otherwise call kbd_buffer_store_event.
1252 (ns_send_appdefined): Remove release of fd_entry.
1253 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1254 Increment and decrement apploopnr.
1255 (ns_select): If no file descriptors, just do a NSTimer.
1256 Otherwise copy read/write masks and start select thread (fd_handler).
1257 Start main loop and wait for application defined event.
1258 Inform select thread to stop selecting after main loop is exited.
1259 (ns_term_init): Create selfds pipe and set non-blocking.
1260 Initialize select_mutex. Start the select thread (fd_handler).
1261 (fd_handler:): Loop forever, wait for info from the main thread
1262 to either start or stop selecting. When select returns, send
1263 and appdefined event.
1264 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1265 If not call kbd_buffer_store_event.
1267 * nsterm.h (EmacsApp): fd_handler takes id argument.
1268 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1270 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1272 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1274 * region-cache.c (move_cache_gap): Update gap_len using the actual
1275 growth of the boundaries array. Do not change cache_len.
1278 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1280 Generalize and cleanup font subsystem checks.
1281 * font.h (FONT_DEBUG, font_assert): Remove.
1282 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1283 Change font_assert to eassert. Use eassert where appropriate.
1285 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1287 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1289 2012-08-15 Chong Yidong <cyd@gnu.org>
1291 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1292 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1293 extract the font descriptor instead of just the font name.
1294 In that case, return a font spec instead of a string.
1295 (x_last_font_name): Move to this file from xfns.c.
1297 * xfns.c (Fx_select_font): The return value can also be a font
1298 spec. Move x_last_font_name management to gtkutil.c.
1300 * xfaces.c: Make font weight and style symbols non-static.
1302 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1304 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1307 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1309 * alloc.c (Fgarbage_collect): Use plural form consistently.
1311 2012-08-14 Eli Zaretskii <eliz@gnu.org>
1313 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1314 iteration through the command loop. Fixes a problem whereby mouse
1315 movements are ignored until the first mouse click.
1317 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1319 Use bool, not int, for Lisp booleans.
1320 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1321 makes Emacs a bit smaller and presumably a bit faster.
1322 * lisp.h: Include <stdbool.h>.
1323 (struct Lisp_Boolfwd, defvar_bool):
1324 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1325 * regex.c [!emacs]: Include <stdbool.h>.
1326 (false, true): Remove; <stdbool.h> does this for us now.
1328 2012-08-14 Chong Yidong <cyd@gnu.org>
1330 * character.c (Fcharacterp): Doc fix (Bug#12076).
1332 * data.c (Findirect_variable): Doc fix (Bug#11040).
1334 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1336 * editfns.c (Fformat): Doc fix (Bug#12059).
1337 (Fsave_current_buffer): Doc fix (Bug#11542).
1339 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1341 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1344 2012-08-14 Martin Rudalics <rudalics@gmx.at>
1346 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1347 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1348 * minibuf.c (choose_minibuf_frame, read_minibuf):
1349 * w32fns.c (x_create_tip_frame):
1350 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1351 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1353 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1355 * intervals.c (offset_intervals): Remove obsolete comment.
1357 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1359 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1361 2012-08-14 Gergely Risko <gergely@risko.hu>
1363 * coding.c (decode_coding): Record buffer modification before
1364 disabling undo_list (Bug#11773).
1366 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1368 Revert and cleanup some recent overlay changes.
1369 * buffer.h (enum overlay_type): Remove.
1370 (buffer_get_overlays, buffer_set_overlays): Likewise.
1371 (buffer_set_overlays_before, buffer_set_overlays_after):
1372 New function. Adjust users.
1373 (unchain_both): Add eassert.
1375 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1377 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1379 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1381 * gtkutil.c (xg_mark_data): Don't assume C99.
1383 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1385 * gtkutil.c (xg_frame_tb_info): New struct.
1386 (TB_INFO_KEY): New define.
1387 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1388 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1389 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1391 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1392 is up to date. Otherwise store new data.
1393 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1395 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1397 Use KSET for write access to Lisp_Object members of struct kboard.
1398 * keyboard.h (KSET): New macro.
1399 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1400 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1401 * xterm.c: Adjust users.
1403 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1405 Use BSET for write access to Lisp_Object members of struct buffer.
1406 * buffer.h (BSET): New macro.
1407 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1408 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1409 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1410 * window.c, xdisp.c, xfns.c: Adjust users.
1412 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1414 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1416 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1418 * nsterm.m (not_in_argv): New function.
1419 (application:openFile, application:openTempFile:):
1420 (application:openFileWithoutUI:, application:openFiles:): Open file
1421 if not_in_argv returns non-zero (bug#12171).
1423 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
1424 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1425 Define for Gtk+ versions less than 3.2.
1426 (xg_get_font_name): Use those functions/macros here.
1427 Reported by Frans Oilinki <moilinki@gmail.com>.
1429 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1431 * unexmacosx.c (copy_data_segment): Copy initialized data in
1432 statically linked libraries from input file rather than memory.
1434 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1435 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1436 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1438 2012-08-10 Glenn Morris <rgm@gnu.org>
1440 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1441 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1443 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1445 Fix last change to allow compilation with low optimization levels.
1446 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1447 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1449 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1451 Use common inline syntax in intervals.h.
1452 * intervals.h (INTERVALS_INLINE): New macro.
1453 Change all users from LISP_INLINE.
1455 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1457 Define Qnone once for all platforms.
1458 * frame.c (Qnone): Define here.
1459 (syms_of_frame): DEFSYM it.
1460 * lisp.h (Qnone): New declaration.
1461 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1462 * xfns.c: Remove duplication. Adjust users.
1464 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1466 Remove unused macros from intervals.h.
1467 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1468 * intervals.c: Adjust comment.
1470 2012-08-10 Eli Zaretskii <eliz@gnu.org>
1472 * w32fns.c <w32_unicode_gui>: New static variable.
1473 (globals_of_w32fns): Initialize it according to os_subtype.
1474 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1477 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
1478 Eli Zaretskii <eliz@gnu.org>
1480 Fix bug #10299 with Unicode characters sent by customized
1481 keyboards created by MSKLC.
1482 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1483 (w32_init_class): Use it to initialize the Emacs class with either
1484 ANSI or Unicode API calls.
1485 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1487 (w32_wnd_proc): If the character code sent by WM_CHAR or
1488 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1489 original message. Call DefWindowProcW on NT and later.
1491 2012-08-10 Glenn Morris <rgm@gnu.org>
1493 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1495 * lisp.h (DIRECTORY_SEP): Let configure set it.
1497 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1499 Use TSET for write access to Lisp_Object slots of struct terminal.
1500 * termhooks.h (TSET): New macro.
1501 * coding.c, terminal.c, xselect.c: Adjust users.
1503 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1505 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1506 the failing expression, include them in the error message.
1507 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1508 * lisp.h (internal_condition_case_n): Update declaration.
1510 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1512 Inline functions to examine and change buffer overlays.
1513 * buffer.c (unchain_both): New function.
1514 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1515 (buffer_has_overlays): New function.
1516 (enum overlay_type): New enum.
1517 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1518 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1520 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1522 Inline functions to examine and change buffer intervals.
1523 * alloc.c (mark_interval_tree): Remove.
1524 (MARK_INTERVAL_TREE): Simplify.
1525 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1526 * intervals.c (buffer_balance_intervals): New function.
1527 (graft_intervals_into_buffer): Adjust indentation.
1528 (set_intervals_multibyte): Simplify.
1529 * buffer.h (BUF_INTERVALS): Remove.
1530 (buffer_get_intervals, buffer_set_intervals): New function.
1531 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1532 * intervals.c, textprop.c: Adjust users.
1534 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1536 Inline functions to examine and change string intervals.
1537 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1538 (string_get_intervals, string_set_intervals): New function.
1539 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1540 * lread.c, print.c, textprop.c: Adjust users.
1542 2012-08-08 Glenn Morris <rgm@gnu.org>
1544 * lisp.mk (lisp): Remove language/persian.elc.
1546 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1549 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1550 (NULL_INTERVAL_P): Likewise. Adjust users.
1551 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1552 Adjust comment. Move under #if 0.
1553 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1554 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1556 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1558 Check total length of intervals with eassert.
1559 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1560 * intervals.c: Change all users to eassert.
1562 2012-08-07 Eli Zaretskii <eliz@gnu.org>
1564 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1565 Rename fields to match removal of FGET and WGET and disuse of
1566 INTERNAL_FIELD in Lisp_Cons.
1568 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1570 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1571 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1572 name since all xname users are fixed long time ago. Do not
1574 (set_symbol_name, set_symbol_function, set_symbol_plist):
1575 (set_symbol_next, set_overlay_plist): New function.
1576 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1577 (struct Lisp_Overlay): Likewise.
1578 (CVAR, MVAR, SVAR): Remove.
1579 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1580 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1581 * xterm.c: Adjust users.
1582 * .gdbinit: Change to use name field of struct Lisp_Symbol
1585 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1587 Basic functions to set Lisp_Object and pointer slots of intervals.
1588 * intervals.h (interval_set_parent, interval_set_object):
1589 (interval_set_left, interval_set_right, interval_set_plist):
1590 (interval_copy_parent): New function.
1591 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
1592 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1594 (INTERVAL_SIZE): Remove. Adjust users.
1595 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1597 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1599 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1600 * process.h (PGET): Remove.
1601 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1602 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1604 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1606 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1607 * window.h (WGET): Remove.
1608 (struct window): Do not use INTERNAL_FIELD.
1609 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1610 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1611 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1612 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1613 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1616 2012-08-07 Chong Yidong <cyd@gnu.org>
1618 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1619 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1620 (Fdelete_window_internal): Signal an error if the window is not on
1621 a live frame (Bug#12025).
1623 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1625 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1626 * frame.h (FGET): Remove.
1627 (struct frame): Do not use INTERNAL_FIELD.
1628 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1629 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1630 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1631 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1633 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
1635 * w32.c: Silence compiler warnings.
1636 (map_w32_filename): Remove unused variable `is_fat'.
1637 (chase_symlinks): Add parentheses around expression.
1639 2012-08-06 Glenn Morris <rgm@gnu.org>
1641 * sysdep.c: Respect BROKEN_GETWD.
1643 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1644 Let configure handle it.
1645 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1647 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1649 Use GCALIGNMENT where appropriate.
1650 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1651 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1652 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1654 2012-08-06 Eli Zaretskii <eliz@gnu.org>
1656 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1657 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
1659 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1661 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1662 that should be sufficient for everyone.
1664 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1666 * keyboard.c (timer_check_2): Add break so timer_check returns next
1669 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1671 Fix Windows build errors introduced after converting to WGET and WSET.
1672 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1673 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1675 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1677 * nsterm.m (ns_frame_rehighlight): Use FSET.
1679 * nsmenu.m (ns_update_menubar): Use FSET.
1681 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1683 Separate read and write access to Lisp_Object slots of Lisp_Process.
1684 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1685 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1687 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1689 Separate read and write access to Lisp_Object slots of struct window.
1690 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1691 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1692 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1693 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1694 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1695 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1698 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1700 Fix Windows build errors introduced after converting to FGET and FSET.
1701 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1702 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1703 (w32_judge_scroll_bars): Change to use FSET.
1704 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1706 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1708 Fix replacement typo.
1709 * window.c (replace_window): Set root_window instead of
1710 selected_window. This fixes a total window subsystem
1711 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1713 2012-08-06 Glenn Morris <rgm@gnu.org>
1715 * lisp.mk (lisp): Add language/persian.elc.
1717 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1719 Separate read and write access to Lisp_Object slots of struct frame.
1720 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1721 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1722 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1723 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1724 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1726 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1728 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1730 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1732 Generalize common compile-time constants.
1733 * lisp.h (header_size, bool_header_size, word_size): Now here.
1734 (struct Lisp_Vector): Add comment.
1735 (struct Lisp_Bool_Vector): Move up to define handy constants.
1736 (VECSIZE, PSEUDOVECSIZE): Simplify.
1737 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1738 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1739 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1740 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1741 * xfont.c, xmenu.c: Use word_size where appropriate.
1743 2012-08-05 Lawrence Mitchell <wence@gmx.li>
1745 * search.c (Freplace_match): Treat \? in the replacement text
1746 literally (Bug#8161).
1748 2012-08-05 Chong Yidong <cyd@gnu.org>
1750 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1751 * frame.c (Vdelete_frame_functions):
1752 * emacs.c (Vkill_emacs_hook): Doc fix.
1754 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1756 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1757 --with-x-toolkit=no builds.
1758 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1760 2012-08-04 Chong Yidong <cyd@gnu.org>
1762 * syntax.c (Fmodify_syntax_entry): Doc fix.
1764 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1766 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1767 * w32.c (init_environment): Change the default values of many
1768 environment variables in dflt_envvars[] to NULL, to avoid pushing
1769 them into environment when they were not already defined.
1770 Remove the code that deletes site-lisp subdirectories from the default
1771 value of EMACSLOADPATH, as it is no longer needed.
1772 (check_windows_init_file): Now external, not static.
1773 Use Vload_path as is, without adding anything, as this function is now
1774 called when Vload_path is already set up.
1776 * w32.h (check_windows_init_file): Add prototype.
1778 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1779 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1780 compatibility with Posix platforms.
1781 (main): Move the call to check_windows_init_file to here from
1783 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1784 any, in the DEFALT argument into the root of the Emacs build or
1785 installation tree, as appropriate.
1787 * callproc.c (init_callproc_1): Call decode_env_path instead of
1788 doing its equivalent by hand.
1789 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1790 the code that sets Vexec_path run on MS-Windows.
1792 * lread.c (init_lread): Add comments to #ifdef's.
1794 * msdos.c (dos_set_window_size, IT_update_begin)
1795 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1796 instead of direct references.
1798 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1800 Export DEFAULT_REHASH_* to GDB.
1801 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1802 Now constants, not macros.
1804 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1806 Remove unnecessary casts involving pointers.
1807 These casts are no longer needed now that we assume C89 or later,
1808 since they involve casting to or from void *.
1809 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1810 (make_pure_float, make_pure_vector):
1811 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1812 * macros.c (Fstart_kbd_macro):
1813 * menu.c (find_and_return_menu_selection):
1814 * minibuf.c (read_minibuf_noninteractive):
1815 * sysdep.c (closedir):
1816 * xdisp.c (x_produce_glyphs):
1817 * xfaces.c (compare_fonts_by_sort_order):
1818 * xfns.c (x_real_positions, select_visual):
1819 * xselect.c (x_stop_queuing_selection_requests)
1820 (x_get_window_property, x_get_window_property_as_lisp_data):
1821 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1822 Remove unnecessary pointer casts.
1823 * alloc.c (record_xmalloc): New function.
1824 * lisp.h (record_xmalloc): New decl.
1825 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1826 more like a function. This is because the pointer cast is not
1827 needed. All uses changed.
1828 * print.c (print_string, print_error_message): Avoid length recalc.
1830 Improve fix for macroexp crash with debugging (Bug#12118).
1831 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1832 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1833 not supposed to be invoked from the garbage collector.
1834 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1835 (gc_aset): New function, which is like ASET but can be
1836 used in the garbage collector.
1837 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1838 (set_hash_index): Use it instead of ASET.
1840 2012-08-03 Eli Zaretskii <eliz@gnu.org>
1842 Support symlinks on latest versions of MS-Windows.
1843 * w32.c: Include winioctl.h and aclapi.h.
1844 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1845 (revert_to_self): Forward declarations of static functions.
1846 <static BOOL g_b_init_get_security_info>:
1847 <g_b_init_create_symbolic_link>: New static flags.
1848 (globals_of_w32): Initialize them to zero.
1849 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1850 (map_w32_filename): Improve commentary. Simplify switch.
1851 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1852 headers (most versions of MinGW w32api don't).
1853 (get_security_info, create_symbolic_link)
1854 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1856 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1857 in the argument file name.
1858 (sys_access): Call unc_volume_file_attributes only if
1859 GetFileAttributes fails with network-related error codes.
1860 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1861 have the required privileges.
1862 (get_file_security_desc_by_name): Rename from
1863 get_file_security_desc.
1864 (stat_worker): New function, with most of the guts of 'stat', and
1865 with addition of handling of symlinks and support for 'lstat'.
1866 If possible, get file's attributes and security information by
1867 handle, not by name. Produce S_IFLNK bit for symlinks, when
1868 called from 'lstat'.
1869 (stat, lstat): New functions, call 'stat_worker'.
1870 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1871 symlinks when the underlying filesystem supports them.
1873 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1875 Fix macroexp crash on Windows with debugging (Bug#12118).
1876 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1877 checking subscripts; problem introduced with the recent
1878 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1879 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1880 since it's used in non-static inline functions now.
1882 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1883 Don't assume buffer size fits in 'int'. Remove unused local.
1885 Use C99-style 'extern inline' if available.
1886 * buffer.h (BUFFER_INLINE):
1887 * category.h (CATEGORY_INLINE):
1888 * character.h (CHARACTER_INLINE):
1889 * charset.h (CHARSET_INLINE):
1890 * composite.h (COMPOSITE_INLINE):
1891 * dispextern.h (DISPEXTERN_INLINE):
1892 * lisp.h (LISP_INLINE):
1893 * systime.h (SYSTIME_INLINE):
1894 New macro, replacing 'static inline' in this header.
1895 * buffer.h, category.h, character.h, charset.h, composite.h:
1896 * dispextern.h, lisp.h, systime.h:
1897 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1898 * alloc.c (LISP_INLINE):
1899 * buffer.c (BUFFER_INLINE):
1900 * category.c (CATEGORY_INLINE):
1901 * character.c (CHARACTER_INLINE):
1902 * charset.c (CHARSET_INLINE):
1903 * composite.c (COMPOSITE_INLINE):
1904 * dispnew.c (DISPEXTERN_INLINE):
1905 * sysdep.c (SYSTIME_INLINE):
1906 Define to EXTERN_INLINE, so that the corresponding functions
1907 are compiled into code.
1908 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1909 (INLINE_HEADER_END): New macros.
1910 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1911 since it's used in non-static inline functions now.
1912 (VALMASK) [!USE_LSB_TAG]: Likewise.
1914 2012-08-02 Glenn Morris <rgm@gnu.org>
1916 * s/: Remove empty directory.
1918 * s/ms-w32.h: Move to ../nt/inc.
1919 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1920 Update for new ms-w32.h location.
1922 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1925 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1927 2012-08-02 Glenn Morris <rgm@gnu.org>
1929 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1930 hard-coding the path separator.
1932 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1934 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1935 This how ASET and AREF are supposed to work, and makes
1936 it easier to think about future improvements. See
1937 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1938 * charset.h (set_charset_attr): New function.
1939 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1940 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1941 (aref_addr): New function. All uses of &AREF(...) changed.
1942 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1943 (set_hash_index): New functions. All lvalue-style uses of
1944 HASH_KEY etc. changed.
1945 * keyboard.c (set_prop): New function. All lvalue-style uses
1948 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1950 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1951 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1952 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1953 * nsfns.m (ns_set_name_as_filename): Likewise.
1954 * nsmenu.m (ns_update_menubar): Likewise.
1955 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1957 2012-08-01 Eli Zaretskii <eliz@gnu.org>
1959 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1960 Adapt to latest changes in field names of the corresponding Lisp
1963 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1965 2012-08-01 Glenn Morris <rgm@gnu.org>
1967 * s/msdos.h: Remove file.
1968 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1969 * Makefile.in (S_FILE): Remove.
1970 (config_h): Remove S_FILE.
1972 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
1974 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1975 Remove; moved to nt/config.nt.
1977 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1979 Use INTERNAL_FIELD for conses and overlays.
1980 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1981 Remove obsolete comment.
1983 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1984 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1986 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1988 Use INTERNAL_FIELD for symbols.
1989 * lisp.h (SVAR): New macro. Adjust users.
1990 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1991 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1993 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1995 Use INTERNAL_FIELD for processes.
1996 * process.h (PVAR): New macro. Adjust style.
1997 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1998 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2000 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2002 Use INTERNAL_FIELD for windows.
2003 * window.h (WVAR): New macro.
2004 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2005 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2006 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2007 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2008 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2009 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2011 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2013 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2015 2012-08-01 Glenn Morris <rgm@gnu.org>
2017 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2018 Move to configure.ac.
2020 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2022 * makefile.w32-in (CONFIG_H): Update dependencies.
2023 (CONF_POST_H): New macro.
2025 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2027 2012-07-31 Glenn Morris <rgm@gnu.org>
2029 * Makefile.in (S_FILE): No longer set by configure.
2031 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2033 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2035 * process.h (NULL_DEVICE):
2036 * emacs.c (SEPCHAR):
2037 * editfns.c (USER_FULL_NAME): Let configure set them.
2039 * s/README, s/template.h: Remove files.
2041 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2043 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2044 Move to configure.ac.
2046 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2048 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2049 resulting renaming of 'struct frame' members.
2051 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2053 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2054 after introduction of FVAR.
2056 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2058 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2060 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2061 instead of compositeToPoint.
2062 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2064 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2066 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2068 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2069 * lisp.h (INTERNAL_FIELD): New macro.
2070 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2071 (BVAR): Change to use INTERNAL_FIELD.
2072 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2073 (KVAR): Change to use INTERNAL_FIELD.
2074 * frame.h (FVAR): New macro.
2075 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2076 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2077 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2078 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2079 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2081 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2083 Miscellaneous fixes for non-default X toolkits.
2084 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2085 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2086 Move under #ifdef USE_LUCID.
2087 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2088 definition and usage to avoid warnings.
2090 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2092 * nsterm.m (openFiles): Fix previous checkin.
2094 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2096 * indent.c (compute_motion): Remove unused local.
2098 2012-07-31 Glenn Morris <rgm@gnu.org>
2100 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2102 * conf_post.h [USG5_4]:
2103 Move remaining contents of s/usg5-4-common.h here.
2104 * s/usg5-4-common.h: Remove file.
2106 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2107 * s/irix6-5.h: Remove file.
2109 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2110 * s/darwin.h: Remove file.
2112 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2113 * s/hpux10-20.h: Remove file, which is now empty.
2115 2012-07-30 Glenn Morris <rgm@gnu.org>
2117 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2118 * Makefile.in (config_h): Add conf_post.h.
2119 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2121 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2123 * nsterm.m (ns_do_open_file): New variable.
2124 (ns_term_init): Set ns_do_open_file to YES after run returns.
2125 (openFile, openTempFile, openFileWithoutUI, openFiles):
2126 Open files only if ns_do_open_file.
2128 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2130 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2131 This no-op macro hasn't been needed for many years.
2132 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2134 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2135 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2136 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2137 gdb_make_enums_visible.
2138 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2139 (DIRECTORY_SEP): Now a constant, not a macro.
2141 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2143 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2144 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2146 * w32term.c <w32_keyboard_codepage>: Renamed from
2147 keyboard_codepage and now external. All users changed.
2149 * w32term.h: Add declaration of w32_keyboard_codepage.
2151 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2152 the codepage to translate keys to Unicode. If this argument is
2153 -1, use the value returned by GetConsoleCP. All callers changed.
2155 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2157 Update .PHONY listings in makefiles.
2158 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2159 bootstrap-clean, distclean, maintainer-clean, versioclean,
2162 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2163 This is a bit clearer. Fix some commentary typos.
2165 2012-07-30 Glenn Morris <rgm@gnu.org>
2167 * s/netbsd.h: Let configure include signal.h if needed.
2168 Remove file, which is now empty.
2170 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2171 Let configure set them.
2172 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2173 No more need to undefine.
2175 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2177 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2178 non-single-byte char when adding meta modifier. (Bug#12090)
2180 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2182 Convert safe_call to use variable number of arguments.
2183 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2184 (safe_call2): Fix comment.
2185 * lisp.h (safe_call): Adjust prototype.
2186 * coding.c (encode_coding_object): Change to use safe_call2.
2187 * xfaces.c (merge_face_heights): Change to use safe_call1.
2189 2012-07-30 Glenn Morris <rgm@gnu.org>
2191 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2192 does that unconditionally. Remove file, which is now empty.
2194 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2197 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2199 Export to GDB most of lisp.h's remaining object-like macros.
2200 * lisp.h (min, max): Move earlier, because they're used earlier now.
2201 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2202 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2203 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2204 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2205 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2206 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2207 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2208 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2209 Now constants, for GDB. They need not be macros.
2210 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2211 Now constants, for GDB, as well as macros, for static initializers.
2212 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2213 Move to after the definition of struct Lisp_Char_Table,
2214 since the former now needs that type defined.
2215 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2216 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2217 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2218 New enums, for gdb_make_enums_visible.
2219 (GLYPH_MODE_LINE_FACE): Remove; unused.
2220 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2221 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2222 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2223 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2224 enum maxargs, enum MAX_ALLOCA.
2225 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2226 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2227 no longer needed, now that they are done in lisp.h.
2229 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2231 Cleanup string bytes checking.
2232 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2233 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2234 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2235 (check_sblock, compact_small_strings): Simplify.
2237 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2239 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2240 These macros are confusing and no longer need to be defined, as
2241 the enum values now suffice. All uses replaced with definiens.
2242 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2244 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2246 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2247 ($(BLD)/w32console.$(O)): Update dependencies.
2249 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2251 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2252 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2254 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2256 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2258 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2259 setting sitelisp (Bug#12010).
2261 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2263 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2265 * w32heap.c (cache_system_info):
2266 * w32.c (sys_rename):
2267 * w32proc.c (find_child_console, sys_kill): All users changed.
2269 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2271 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2273 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2275 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2277 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2279 Cleanup statistics calculation in Fgarbage_collect.
2280 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2281 Fix zombies percentage calculation. Simplify elapsed time calculation.
2283 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2285 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2286 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2287 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2288 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2289 (replace_range, replace_range_2, del_range_2): Change to eassert.
2290 * marker.c (byte_char_debug_check): Adjust style.
2292 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2294 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2295 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2296 long-ago-commented-out code that talks about "WIN32".
2297 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2300 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2302 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2303 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2304 Simplify by using alignof.
2305 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2306 * lisp.h: Include <stdalign.h>.
2307 (GCALIGNMENT): New macro and constant.
2308 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2309 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2310 (stdalign): New macro, if not already defined.
2312 2012-07-28 Eli Zaretskii <eliz@gnu.org>
2314 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2315 * w32inevt.c: Include w32inevt.h.
2316 (w32_read_console_input): New inline function, calls either
2317 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2318 w32_console_unicode_input.
2319 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2320 (w32_kbd_patch_key, key_event): Use the codepage returned by
2321 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2322 (key_event): use uChar.UnicodeChar only if
2323 w32_console_unicode_input is non-zero.
2325 * w32console.c: Include w32heap.h.
2326 <w32_console_unicode_input>: New global variable.
2327 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2328 family of Windows, zero otherwise.
2330 * w32inevt.h: Declare w32_console_unicode_input.
2332 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2333 --without-x. (Bug#11742)
2335 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2337 Adjust GDB to reflect pvec_type changes (Bug#12036).
2338 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2339 2012-07-04 changes to pseudovector representation.
2340 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
2342 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
2344 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2346 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2348 2012-07-27 Eli Zaretskii <eliz@gnu.org>
2350 * alloc.c (listn): Fix the order the arguments are consed onto the
2353 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2354 enumeration constants, as PURE and HEAP are too general, and clash
2355 with other headers and sources, such as gmalloc.c and the
2356 MS-Windows system headers. All users changed.
2358 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2360 Revert last save_excursion_save and save_excursion_restore changes.
2361 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2362 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2364 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2366 Fix recently-introduced typos in Windows port.
2367 Reported by Martin Rudalics <rudalics@gmx.at>.
2368 * w32.c (init_environment): Replace comma with semicolon.
2369 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
2371 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2373 Improve GDB symbol export (Bug#12036).
2374 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2375 arms of an 'if', not using conditional expressions; otherwise GDB
2376 complains about the types in the unevaluated arm when the argument
2377 is an integer literal.
2378 (xgetint): Simplify expression.
2379 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2380 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2381 Zaretskii in <http://bugs.gnu.org/12036#13>.
2382 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2383 needed now that we have gdb_make_enums_visible.
2384 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2385 (enum enum_USE_LSB_TAG):
2386 New enum types, packaging up enums that need to be exported to GDB.
2388 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2390 Utility function to make a list from specified amount of objects.
2391 * lisp.h (enum constype): New datatype.
2392 (listn): New prototype.
2393 * alloc.c (listn): New function.
2394 (Fmemory_use_count, syms_of_alloc): Use it.
2395 * buffer.c (syms_of_buffer): Likewise.
2396 * callint.c (syms_of_callint): Likewise.
2397 * charset.c (define_charset_internal): Likewise.
2398 * coding.c (syms_of_coding): Likewise.
2399 * keymap.c (syms_of_keymap): Likewise.
2400 * search.c (syms_of_search): Likewise.
2401 * syntax.c (syms_of_syntax): Likewise.
2402 * w32.c (init_environment): Likewise.
2403 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2404 * xdisp.c (syms_of_xdisp): Likewise.
2405 * xfns.c (syms_of_xfns): Likewise.
2407 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2409 Fast save_excursion_save and save_excursion_restore.
2410 * lisp.h (struct Lisp_Excursion): New data type.
2411 (PVEC_EXCURSION): New pseudovector type.
2412 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2413 to deal with it. Adjust comments.
2414 (init_marker, attach_marker): New prototype.
2415 (unchain_marker): Adjust prototype.
2416 * marker.c (attach_marker): Change to global.
2417 (init_marker): New function.
2418 * alloc.c (Fmake_marker, build_marker): Use it.
2419 (build_marker): More easserts.
2420 (mark_object): Handle struct Lisp_Excursion.
2421 * editfns.c (save_excursion_save, save_excursion_restore):
2422 Reimplement to use struct Lisp_Excursion. Add comments.
2424 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2426 Fix export of symbols to GDB (Bug#12036).
2427 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2428 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2429 emacs.c, as this is a more-suitable home. Had this been done earlier
2430 the fix for 12036 would have avoided some of the problems noted in
2431 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2432 would have been more obvious.
2433 * emacs.c: Do not include <verify.h>; no longer needed.
2434 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
2435 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2436 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2437 Remove; now done in lisp.h.
2438 * lisp.h (PUBLISH_TO_GDB): New macro.
2439 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2440 (DATA_SEG_BITS): Use it.
2441 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2442 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2443 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2444 not be usable in #if. This simplifies things.
2446 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
2448 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2450 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2452 Simplify export of symbols to GDB (Bug#12036).
2453 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2454 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2455 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2456 Adjust to changes in lisp.h and emacs.c, by using
2457 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2458 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2459 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2460 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2461 instead of gdb_valbits.
2462 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2463 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2464 instead of gdb_array_mark_flag.
2465 (xboolvector): Get size from $->size, not $->header.size.
2466 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2467 (xreload, hook-run, hookpost-run): Remove.
2468 * emacs.c: Include <verify.h>.
2469 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2470 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2472 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2473 (gdb_USE_LSB_TAG): New enum constants.
2474 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2475 Also define these as enum constants, so they're visible to GDB.
2476 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2477 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2478 as constants, so they're visible to GDB.
2479 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2480 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2481 Now enum constants, not macros, so they're visible to GDB.
2482 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2483 more convenient now. All uses changed.
2484 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2485 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2487 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2489 Explicitly free restriction data that are not needed anymore.
2490 * editfns.c (save_restriction_restore): Free restriction data.
2492 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2494 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2495 add argument, tune behavior, and adjust all callers.
2497 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2499 Use typedef for EMACS_INT, EMACS_UINT.
2500 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2501 than macros. This simplifies debugging in the usual case, since
2502 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2503 and it allows expressions involving EMACS_INT casts.
2504 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2506 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2508 * nsterm.m (ns_read_socket): Return early if there is a modal
2511 2012-07-25 Martin Rudalics <rudalics@gmx.at>
2513 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2514 that FOCUS-FRAME can be omitted.
2516 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2518 Adjust buffer text indirection counters at the end of Fkill_buffer.
2519 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2520 buffer is definitely dead. This should really fix an issue reported
2521 by Christoph Scholtes again. (Bug#12007).
2522 (init_buffer_once): Initialize indirection counters of
2523 buffer_defaults and buffer_local_symbols (for sanity and safety).
2525 2012-07-24 Eli Zaretskii <eliz@gnu.org>
2527 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2528 and continuation glyphs on tooltip frames, leave them at zero.
2529 Avoids continued lines in tooltips. (Bug#11832)
2531 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2533 Simplify copy_overlay.
2534 * buffer.c (copy_overlay): Simplify. Use build_marker.
2535 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2537 2012-07-23 Eli Zaretskii <eliz@gnu.org>
2539 * print.c (print_object): Don't crash when a frame's name is nil
2540 or invalid. (Bug#12025)
2542 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2543 it signals an error when a tooltip frame is being created.
2545 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2547 Cleanup miscellaneous objects allocation and initialization.
2548 * alloc.c (allocate_misc): Change to static. Add argument to
2549 specify the subtype. Adjust comment and users.
2550 (build_overlay): New function.
2551 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2552 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2553 (allocate_misc): Remove prototype.
2554 (build_overlay): Add prototype.
2556 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2558 Swap buffer text indirection counters in Fbuffer_swap_text.
2559 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2560 This avoids crash reported by Christoph Scholtes at
2561 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2563 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2565 * nsmenu.m (Popdown_data): New struct.
2566 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2568 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2569 (initWithContentRect): Make imgView and contentView non-static
2570 and autorelease them. Also autorelease img and matrix (Bug#12005).
2571 (dealloc): Remove (Bug#12005).
2573 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2575 Adjust consing_since_gc when objects are explicitly freed.
2576 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2577 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2578 (free_cons, free_misc): Subtract object size from consing_since_gc.
2580 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2582 Simplify and cleanup markers positioning code.
2583 * marker.c (attach_marker): More useful eassert.
2584 (live_buffer, set_marker_internal): New function.
2585 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2586 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2588 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2590 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2591 as it's limited by the amount of memory, not by INT_MAX.
2593 2012-07-21 Eli Zaretskii <eliz@gnu.org>
2595 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2596 in special-event-map. See the discussion at
2597 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2600 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2601 info.dwItemData. Fixes crashes on 64-bit Windows.
2602 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2604 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2606 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
2607 (conversationIdentifier): Return value is NSInteger.
2608 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
2610 2012-07-21 Chong Yidong <cyd@gnu.org>
2612 * window.c (decode_any_window): Signal an error if the window is
2613 on a dead frame (Bug#11984).
2615 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2617 Add indirection counting to speed up Fkill_buffer.
2618 * buffer.h (struct buffer): New member.
2619 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2620 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2621 base buffer indirection counter.
2622 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2623 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2624 through buffer list if indirection counter is 0.
2626 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2628 Extend the value returned by Fgarbage_collect with heap statistics.
2629 * alloc.c (Qheap): New symbol.
2630 (syms_of_alloc): DEFSYM it.
2631 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2632 (Fmemory_free): Remove.
2633 (syms_of_alloc): Don't defsubr it.
2634 * buffer.c (Fcompact_buffer): Remove.
2635 (syms_of_buffer): Don't defsubr it.
2637 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2639 Make maybe_gc inline.
2640 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2641 * lisp.h (consing_since_gc, gc_relative_threshold)
2642 (memory_full_cons_threshold): Revert declaration.
2643 (maybe_gc): Remove prototype, define as inline.
2644 * alloc.c: Remove old commented-out code.
2645 (consing_since_gc, gc_relative_threshold)
2646 (memory_full_cons_threshold): Revert to global.
2649 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2651 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2652 * lisp.h (build_unibyte_string): New function.
2653 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2654 * sysdep.c, w32fns.c, xfns.c: Use it.
2655 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2656 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2657 Adjust users accordingly.
2658 * font.h (font_open_by_name): Adjust prototype.
2660 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2662 Cleanup calls to Fgarbage_collect.
2663 * lisp.h (maybe_gc): New prototype.
2664 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2665 Remove declarations.
2666 * alloc.c (maybe_gc): New function.
2667 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2669 * bytecode.c (MAYBE_GC): Use maybe_gc.
2670 * eval.c (eval_sub, Ffuncall): Likewise.
2671 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2672 to avoid dependency from auto-save feature.
2674 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2676 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2677 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2678 'for_each_per_buffer_object_at'.
2679 All uses changed. It's better to use upper-case for macros that
2680 cannot be implemented as functions, to give the reader a clue
2681 that they're special.
2683 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2685 * alloc.c (Fgarbage_collect): Tweak docstring.
2687 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2689 Tweak the value returned from Fgarbage_collect again.
2690 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2691 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2692 Adjust documentation.
2693 (total_vector_bytes): Rename to total_vector_slots, adjust
2695 (total_free_vector_bytes): Rename to total_free_vector_slots,
2697 (Qstring_bytes, Qvector_slots): New symbols.
2698 (syms_of_alloc): DEFSYM them.
2700 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2702 Buffer compaction primitive which may be used from Lisp.
2703 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2704 (syms_of_buffer): Register Fcompact_buffer.
2705 * alloc.c (Fgarbage_collect): Use compact_buffer.
2706 * buffer.h (compact_buffer): New prototype.
2707 (struct buffer_text): New member.
2709 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2711 New macro to iterate over all buffers, miscellaneous cleanups.
2712 * lisp.h (all_buffers): Remove declaration.
2713 * buffer.h (all_buffers): Add declaration, with comment.
2714 (for_each_buffer): New macro.
2715 * alloc.c (Fgarbage_collect, mark_object): Use it.
2716 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2717 (init_buffer): Likewise.
2718 * data.c (Fset_default): Likewise.
2719 * coding.c (code_conversion_restore): Remove redundant check
2721 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2723 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2725 Fix bug that created negative-length intervals.
2726 * intervals.c (merge_interval_right, merge_interval_left):
2727 Do not zero out this interval if it is absorbed by its children,
2728 as this interval's total length doesn't change in that case. See
2729 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2731 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2733 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2734 when invoking (make-bool-vector N t) and N is a positive
2735 multiple of 8 -- the last 8 bits were mistakenly cleared.
2737 Remove some struct layout assumptions in bool vectors.
2738 * alloc.c (bool_header_size): New constant.
2739 (header_size, word_size): Move earlier, as they're now used earlier.
2740 Use 'word_size' in a few more places, where it's appropriate.
2741 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2742 padding before the data member of a bool vector.
2743 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2744 than doing the check by hand with an abort ().
2746 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2748 * eval.c (Fdefvar): Don't check constants since we only set the var if
2749 it's not yet defined anyway (bug#11904).
2751 * lisp.h (last_undo_boundary): Declare new var.
2752 * keyboard.c (command_loop_1): Set it.
2753 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2754 were auto-added by the command loop (bug#11774).
2756 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2758 * w32font.c (Qsymbol): Remove local definition.
2759 (syms_of_w32font): Don't DEFSYM it.
2761 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2763 Fix sweep_vectors to handle large bool vectors correctly.
2764 * alloc.c (sweep_vectors): Account total_vector_bytes for
2765 bool vectors larger than VBLOCK_BYTES_MAX.
2767 2012-07-18 Chong Yidong <cyd@gnu.org>
2769 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2770 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2772 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2774 Return more descriptive data from Fgarbage_collect.
2775 Suggested by Stefan Monnier in
2776 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2777 * alloc.c (bounded_number): New function.
2778 (total_buffers, total_vectors): New variable.
2779 (total_string_size): Rename to total_string_bytes, adjust users.
2780 (total_vector_size): Rename to total_vector_bytes, adjust users.
2781 (sweep_vectors): Account total_vectors and total_vector_bytes.
2782 (Fgarbage_collect): New return value. Adjust documentation.
2783 (gc_sweep): Account total_buffers.
2784 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2785 (VECTOR_SIZE): Remove.
2786 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2787 (Qinterval, Qmisc): New symbols.
2788 (syms_of_data): Initialize them.
2789 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2790 (Qcons, Qbuffer): New declarations.
2792 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2794 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2795 Round up, not down. Improve doc.
2797 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2799 Restore old code in allocate_string_data to avoid Faset breakage.
2800 Reported by Julien Danjou <julien@danjou.info> in
2801 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2802 * alloc.c (allocate_string_data): Restore old code with minor
2803 adjustments, fix comment to explain this subtle issue.
2805 2012-07-17 Eli Zaretskii <eliz@gnu.org>
2807 Remove FILE_SYSTEM_CASE.
2808 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2810 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2811 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2812 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2813 call-process-region passes it through expand-file-name.
2815 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2817 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2819 Fix crash when creating indirect buffer (Bug#11917)
2820 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2821 Don't handle unbound variables specially if non-zero.
2822 (Fbuffer_local_variables): Pass zero.
2823 (clone_per_buffer_values): Pass non-zero.
2825 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2827 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2828 to make the loop interruptible.
2830 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2832 * gnutls.c (emacs_gnutls_handshake): Only retry if
2833 GNUTLS_E_INTERRUPTED.
2835 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2837 Cleanup and convert miscellaneous checks to eassert.
2838 * alloc.c (mark_interval): Fix comment, partially rephrase
2839 old comment from intervals.h (see below).
2840 * intervals.c (find_interval, adjust_intervals_for_insertion)
2841 (delete_interval, adjust_intervals_for_deletion)
2842 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2844 (adjust_intervals_for_insertion, make_new_interval):
2845 Remove obsolete and unused code.
2846 * intervals.h (struct interval): Remove obsolete comment.
2847 * textprotp.c (erase_properties): Remove unused code.
2848 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2849 (Fremove_list_of_text_properties): Convert to eassert.
2851 2012-07-17 Chong Yidong <cyd@gnu.org>
2853 * editfns.c (Finsert_char): Doc fix.
2855 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2857 Fix previous change to make Fmemory_free always accurate.
2858 * alloc.c (make_interval): Update total_free_intervals.
2859 (make_float): Likewise for total_free_floats.
2860 (free_cons, Fcons): Likewise for total_free_conses.
2861 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2862 Likewise for total_free_vector_bytes.
2863 (Fmake_symbol): Likewise for total_free_symbols.
2864 (bytes_free): Remove.
2866 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2868 Simple free memory accounting feature.
2869 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2870 (sweep_vectors): Accumulate size of free vectors.
2871 (Fgarbage_collect): Setup bytes_free.
2872 (Fmemory_free): New function.
2873 (syms_of_alloc): Register it.
2875 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2877 Cleanup overlays checking.
2878 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2879 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2880 eassert and OVERLAYP.
2881 (sort_overlays): Change to use OVERLAYP.
2883 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2885 * editfns.c (Finsert_char): Make it interactive, and make the
2886 second arg optional. Copy interactive spec and docstring from
2889 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2891 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2892 Unlike the other wrapped functions, fabs has an unspecified
2895 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2897 * nsterm.m (keyDown): Interpret flags without left/right bits
2898 as the left key (Bug#11670).
2900 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2902 Remove empty and useless init functions.
2903 * lisp.h (init_character_once, init_fns, init_image)
2904 (init_filelock, init_sound): Remove prototype.
2905 * character.c (init_character_once): Remove.
2906 * filelock.c (init_filelock): Likewise.
2907 * fns.c (init_fns): Likewise.
2908 * image.c (init_image): Likewise.
2909 * sound.c (init_sound): Likewise.
2910 * emacs.c (main): Adjust accordingly.
2912 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2914 * gtkutil.h: Tiny cleanups.
2915 (use_old_gtk_file_dialog): Remove useless declaration.
2916 (xg_uses_old_file_dialog): Add suggested const attribute.
2918 2012-07-15 Eli Zaretskii <eliz@gnu.org>
2920 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2921 (bidi_paragraph_init): Use it to limit search forward for a strong
2922 directional character in abnormally large paragraphs full of
2923 neutral or weak characters. (Bug#11943)
2925 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2927 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2928 the toolbar (Bug#9451).
2929 (xg_make_tool_item): Give the widget event box a transparent
2932 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2934 Cleanup basic allocation variables and functions.
2935 * alloc.c (ignore_warnings, init_intervals, init_float)
2936 (init_cons, init_symbol, init_marker): Remove.
2937 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2938 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2939 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2940 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2941 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2942 (staticidx, init_alloc_once, init_strings, free_ablock):
2943 Remove redundant initialization.
2944 * fns.c (init_weak_hash_tables): Remove.
2945 * lisp.h (init_weak_hash_tables): Remove prototype.
2947 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2949 Use zero_vector where appropriate.
2950 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2952 * lisp.h (zero_vector): New declaration.
2953 * font.c (null_vector): Remove.
2954 (syms_of_font): Remove initialization and staticpro.
2955 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2956 * keymap.c (Faccessible_keymaps): Likewise.
2958 2012-07-15 Leo Liu <sdl.web@gmail.com>
2960 * fringe.c: Fix typo in comments.
2962 2012-07-14 Leo Liu <sdl.web@gmail.com>
2964 * fringe.c: Add a new bitmap exclamation-mark.
2966 2012-07-14 Eli Zaretskii <eliz@gnu.org>
2968 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2970 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2971 (HAVE_MENUS): Don't define, defined by editing config.in with
2973 (GMALLOC_INHIBIT_VALLOC): Don't define.
2974 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2976 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
2978 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2980 2012-07-14 Glenn Morris <rgm@gnu.org>
2982 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2983 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2984 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2986 2012-07-13 Glenn Morris <rgm@gnu.org>
2988 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2990 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2991 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2993 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2995 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2996 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2997 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2998 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3000 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3001 as boolean expression.
3002 (x_set_window_size): Remove unused variable toolbar.
3003 (ns_get_color_default, ns_mod_to_lisp): Remove.
3004 (ns_mouse_position): Remove unused variables xchar and ychar.
3005 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3006 (ns_set_vertical_scroll_bar): Remove unused variable count.
3007 (ns_delete_terminal): Remove unused variable i.
3008 (ns_term_init): Remove unused variables r, g and b.
3009 (mouseDown): Remove unused variable window.
3010 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3011 (initFrameFromEmacs): Remove unused variable vbextra.
3012 (mouseEntered): Remove unused variables p and dpyinfo.
3013 (mouseExited): Remove unused variables p and r.
3014 (ns_define_frame_cursor, ns_clear_frame_area)
3015 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3016 (menuDown): Assign [sender tag] to variable and cast the variable.
3018 * nsterm.h (menuDown): Add id as type to argument sender.
3019 (ns_display_info_for_name): Add Lisp_Object argument.
3020 (ns_term_init): Add Lisp_Object argument.
3021 (ns_map_event_to_object): Add void argument.
3022 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3023 prototype with arguments and only declare if __OBJC__.
3024 (nxatoms_of_nsselect): Add void argument.
3025 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3026 (ns_alloc_autorelease_pool): Add void argument.
3027 (ns_release_autorelease_pool): Add void* argument.
3028 (ns_get_defaults_value): Add const char* argument.
3030 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3031 (initFromContents): Use SSDATA where appropriate.
3032 (ns_update_menubar): Add braces to ambigous if-else.
3033 (initWithTitle): Put () around assignment in if statement.
3034 (ns_menu_show): Remove unused variables window and keymap.
3035 (update_frame_tool_bar): Remove unused variable selected_p.
3036 (initWithContentRect): Remove unused variable this_cmd_name.
3038 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3040 (setXBMColor): Remove unused variable len.
3041 (setPixmapData): Put () around assignment in loop statement.
3043 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3044 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3046 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3047 around assignment in loop statement.
3048 (nsfont_open): Remove unused variable i.
3049 (nsfont_open): Remove unused variable len.
3050 (nsfont_draw): Remove unused variable cs.
3052 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3053 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3054 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3055 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3056 (Fns_font_name, Fns_perform_service)
3057 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3058 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3059 (ns_set_name): Remove unused variable view.
3060 (x_set_menu_bar_lines): Remove unused variable olines.
3061 (x_set_tool_bar_lines): Remove unused variable root_window.
3062 (Fns_list_colors): Put () around assignment in while statement.
3063 (Fns_perform_service): Remove unused variable len.
3064 (Fns_display_usable_bounds): Remove unused variable top.
3065 (syms_of_nsfns): Remove unused variable i.
3067 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3070 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3072 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3073 and free it with DestroyExceptionInfo (Bug#11558).
3075 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3077 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3078 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3079 Set here, not in nt/config.nt.
3081 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3083 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3084 cursor overflow into the last glyph on display line when the right
3085 fringe is off. (Bug#11832)
3087 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3089 * xdisp.c (produce_special_glyphs): Now static.
3090 * dispextern.h (produce_special_glyphs): Remove decl.
3092 2012-07-13 Glenn Morris <rgm@gnu.org>
3094 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3095 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3097 * s/usg5-4-common.h (USG, USG5):
3098 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3099 * s/sol2-6.h (SOLARIS2):
3100 * s/irix6-5.h (IRIX6_5):
3101 * s/hpux10-20.h (USG, USG5, HPUX):
3102 * s/gnu-linux.h (USG, GNU_LINUX):
3103 * s/freebsd.h (BSD_SYSTEM):
3104 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3105 * s/cygwin.h (CYGWIN):
3106 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3107 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3109 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3111 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3113 2012-07-13 Glenn Morris <rgm@gnu.org>
3115 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3117 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3119 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3120 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3122 2012-07-12 Glenn Morris <rgm@gnu.org>
3124 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3126 * process.c (init_process_emacs): Rename from init_process.
3127 The old name is also the name of a Mach system call.
3128 * lisp.h, emacs.c: Update for this name change.
3129 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3132 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3134 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3135 memmove call that removes glyphs covered by the left truncation
3136 glyph. Improve commentary.
3137 (display_line): Fix display of continuation glyphs on GUI frames
3138 when the right fringe is turned off and variable-size fonts are
3139 used in the window. Move the code that appends a stretch glyph to
3140 produce_special_glyphs, so that it could be used for truncation
3141 and continuation glyphs alike.
3142 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3143 glyph of a suitably computed width, to align the special glyphs at
3144 the window margin. Code moved from display_line. (Bug#11832)
3146 2012-07-12 Glenn Morris <rgm@gnu.org>
3148 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3150 * s/gnu-linux.h, s/hpux10-20.h:
3151 Do not unconditionally define HAVE_XRMSETDATABASE.
3153 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3155 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3157 Fix typos that broke OS X build.
3158 Reported by Randal L. Schwartz in
3159 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3160 * nsterm.m (ns_timeout): Add missing local decl.
3161 (ns_get_color): snprintf -> sprintf, to fix typo.
3163 2012-07-12 Glenn Morris <rgm@gnu.org>
3165 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3166 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3167 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3168 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3170 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3171 Move PTY_OPEN to configure.
3173 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3174 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3175 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3177 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3179 Use empty_unibyte_string where applicable.
3180 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3181 * lread.c (read1): Likewise.
3182 * xsettings.c (syms_of_xsettings): Likewise.
3184 2012-07-12 Glenn Morris <rgm@gnu.org>
3186 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3187 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3188 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3189 * s/hpux10-20.h (RUN_TIME_REMAP):
3190 * s/bsd-common.h (TABDLY): Move to configure.
3192 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3194 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3196 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3197 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3199 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3201 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3202 * s/template.h: Move NARROWPROTO to configure.
3204 2012-07-11 Glenn Morris <rgm@gnu.org>
3206 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3207 unused since 2011-01-17 change to systty.h.
3209 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3210 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3211 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3213 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3215 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3217 2012-07-11 Glenn Morris <rgm@gnu.org>
3219 * s/darwin.h, s/gnu-linux.h, s/template.h:
3220 Move INTERRUPT_INPUT to configure.
3222 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3224 Minor adjustments to interning code.
3225 * lisp.h (intern, intern_c_string): Redefine as static inline
3226 wrappers for intern_1 and intern_c_string_1, respectively.
3227 (intern_1, intern_c_string_1): Rename prototypes.
3228 * lread.c (intern_1, intern_c_string_1, oblookup):
3229 Simplify Vobarray checking.
3230 * font.c (font_intern_prop): Likewise. Adjust comment.
3231 * w32font.c (intern_font_name): Likewise.
3233 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3235 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3237 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3238 of Fcar/Fcdr if possible.
3239 * font.c (check_otf_features): Likewise.
3240 * fontset.c (Fnew_fontset): Likewise.
3241 * gnutls.c (Fgnutls_boot): Likewise.
3242 * minibuf.c (read_minibuf): Likewise.
3243 * msdos.c (IT_set_frame_parameters): Likewise.
3244 * xmenu.c (Fx_popup_dialog): Likewise.
3245 * w32menu.c (Fx_popup_dialog): Likewise.
3247 2012-07-11 Glenn Morris <rgm@gnu.org>
3249 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3250 since nothing has defined it on these platforms.
3252 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3253 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3255 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3256 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3257 Move CLASH_DETECTION to configure.
3259 * s/gnu.h: Remove file, which is now empty.
3261 * s/gnu.h, s/gnu-linux.h:
3262 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3264 2012-07-11 John Wiegley <johnw@newartisans.com>
3266 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3267 function attribute, so we only use it if it exists in the
3270 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3272 Avoid call to strlen in fast_c_string_match_ignore_case.
3273 * search.c (fast_c_string_match_ignore_case): Change to use
3274 length argument. Adjust users accordingly.
3275 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3277 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3279 Assume mkdir, rmdir.
3280 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3281 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3284 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3287 * s/hpux10-20.h (HAVE_PERROR): Remove.
3288 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3289 Remove dummy definition, as this problem was obsolete long ago.
3292 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3294 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3296 Avoid calls to strlen in font processing functions.
3297 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
3298 (font_open_by_name): Change to use length argument.
3299 Adjust users accordingly.
3300 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3302 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3303 Change to return ptrdiff_t.
3304 (xfont_list_pattern, xfont_match): Use length returned by
3305 xfont_decode_coding_xlfd.
3306 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3308 2012-07-11 Glenn Morris <rgm@gnu.org>
3310 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3311 Move DONT_REOPEN_PTY to configure.
3313 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3314 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3316 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3318 Remove "#define unix" that is no longer needed (Bug#11905).
3319 * s/aix4-2.h (unix): Remove; no longer needed.
3321 EMACS_TIME simplification (Bug#11875).
3322 This replaces macros (which typically do not work in GDB)
3323 with functions, typedefs and enums, making the code easier to debug.
3324 The functional style also makes code easier to read and maintain.
3325 * systime.h: Include <sys/time.h> on all hosts, not just if
3326 WINDOWSNT, since 'struct timeval' is needed in general.
3327 (EMACS_TIME): Now a typedef, not a macro.
3328 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3330 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3331 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3332 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3333 (EMACS_TIME_LE): Now functions, not macros.
3334 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3335 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3336 which are not functions. All uses rewritten to use:
3337 (make_emacs_time): New function.
3338 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3339 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3340 not functions. All uses rewritten to use the following, respectively:
3341 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3342 (add_emacs_time, sub_emacs_time): New functions.
3343 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
3344 * fileio.c (Fcopy_file):
3345 * xterm.c (XTflash): Get the current time closer to when it's used.
3346 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3348 * bytecode.c (targets): Suppress -Woverride-init warnings.
3350 Simplify by avoiding confusing use of strncpy etc.
3351 * doc.c (Fsnarf_documentation):
3352 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3353 * frame.c (Fmake_terminal_frame):
3354 * gtkutil.c (get_utf8_string):
3356 * nsmenu.m (ns_update_menubar):
3357 * regex.c (regerror):
3358 Prefer memcpy to strncpy and strncat when either will do.
3359 * fileio.c (Fsubstitute_in_file_name):
3360 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3361 (menu_separator_name_p):
3362 * nsmenu.m (ns_update_menubar):
3363 Prefer memcmp to strncmp when either will do.
3364 * nsterm.m: Include <ftoastr.h>.
3366 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3367 Prefer snprintf to strncpy.
3368 * nsterm.m (ns_term_init):
3369 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3370 * nsterm.m (ns_term_init):
3371 Avoid the need for strncpy, by using build_string or
3372 make_unibyte_string directly. Use dtoastr, not snprintf.
3373 * process.c (Fmake_network_process): Diagnose service names that
3374 are too long, rather than silently truncating them or creating
3375 non-null-terminated names.
3376 (Fnetwork_interface_info): Likewise, for interface names.
3377 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3378 Prefer sprintf to strncat.
3379 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3380 Prefer vsnprintf to vsprintf + strncpy.
3382 2012-07-10 Glenn Morris <rgm@gnu.org>
3384 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3385 Clarify fallback case.
3387 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3389 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3390 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3391 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
3392 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
3393 where argument type is known to be a Lisp_Cons.
3395 2012-07-10 Tom Tromey <tromey@redhat.com>
3397 * bytecode.c (BYTE_CODE_THREADED): New macro.
3398 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3399 (enum byte_code_op): New type.
3400 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3401 (exec_byte_code): Use them. Use token threading when applicable.
3403 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3405 Optimize pure C strings initialization.
3406 * lisp.h (make_pure_string): Fix prototype.
3407 (build_pure_c_string): New function, defined as static inline. This
3408 provides a better opportunity to optimize away calls to strlen when
3409 the function is called with compile-time constant argument.
3410 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3411 argument, adjust users accordingly. Use build_pure_c_string where
3413 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3414 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3415 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3417 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3419 Avoid calls to strlen in miscellaneous functions.
3420 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3421 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3422 * lread.c (openp): Likewise.
3424 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3426 Avoid calls to strlen in path processing functions.
3427 * fileio.c (file_name_as_directory): Add comment. Change to add
3428 srclen argument and return the length of result. Adjust users
3430 (directory_file_name): Fix comment. Change to add srclen argument,
3431 swap 1st and 2nd arguments to obey the common convention.
3432 Adjust users accordingly.
3433 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3435 2012-07-10 Glenn Morris <rgm@gnu.org>
3437 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3438 Move PENDING_OUTPUT_COUNT definition to configure.
3440 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3441 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3442 * s/gnu.h (DATA_START): Move definitions to configure.
3444 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3445 We include usg5-4-common.h, which defines them both.
3447 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3448 O_RDONLY already includes it).
3450 Stop ns builds setting the EMACSLOADPATH environment variable.
3451 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3452 Now it does not set EMACSLOADPATH, just returns the load-path string.
3453 * nsterm.h: Update accordingly.
3454 * lread.c [HAVE_NS]: Include nsterm.h.
3455 (init_lread) [HAVE_NS]: Use ns_load_path.
3456 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3458 2012-07-09 Glenn Morris <rgm@gnu.org>
3460 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3461 since the included bsd-common.h does so.
3463 Stop ns builds setting the EMACSPATH environment variable.
3464 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3465 (ns_init_paths): Do not set EMACSPATH.
3466 * nsterm.h (ns_exec_path): Add it.
3467 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3470 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3472 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3474 * process.c (wait_reading_process_output): 'waitchannels' was unset
3475 when read_kbd || !NILP (wait_for_cell); fix this.
3477 Add GCC-style 'const' attribute to functions that can use it.
3478 * character.h (char_resolve_modifier_mask):
3479 * keyboard.h (make_ctrl_char):
3480 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3481 (init_character_once, next_almost_prime, init_fns, init_image)
3482 (flush_pending_output, init_sound):
3483 * mem-limits.h (start_of_data):
3484 * menu.h (finish_menu_items):
3485 Add ATTRIBUTE_CONST.
3486 * emacs.c (DEFINE_DUMMY_FUNCTION):
3487 Declare the dummy function with ATTRIBUTE_CONST.
3488 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3489 Add decls with ATTRIBUTE_CONST.
3491 Minor improvements to make_formatted_string.
3492 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3493 where int is good enough, as vsprintf returns an int.
3494 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3496 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3498 Use make_formatted_string to avoid double length calculation.
3499 * lisp.h (make_formatted_string): New prototype.
3500 * alloc.c (make_formatted_string): New function.
3501 * buffer.c (Fgenerate_new_buffer_name): Use it.
3502 * dbus.c (syms_of_dbusbind): Likewise.
3503 * editfns.c (Fcurrent_time_zone): Likewise.
3504 * filelock.c (get_boot_time): Likewise.
3505 * frame.c (make_terminal_frame, set_term_frame_name)
3506 (x_report_frame_params): Likewise.
3507 * image.c (gs_load): Likewise.
3508 * minibuf.c (get_minibuffer): Likewise.
3509 * msdos.c (dos_set_window_size): Likewise.
3510 * process.c (make_process): Likewise.
3511 * xdisp.c (ensure_echo_area_buffers): Likewise.
3512 * xsettings.c (apply_xft_settings): Likewise.
3514 2012-07-09 Glenn Morris <rgm@gnu.org>
3516 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3517 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3518 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3519 * nsterm.h (ns_etc_directory): Add it.
3520 * callproc.c [HAVE_NS]: Include nsterm.h.
3521 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3523 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3525 Move marker debugging code under MARKER_DEBUG.
3526 * marker.c (MARKER_DEBUG): Move marker debugging code under
3527 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3528 for bootstrap with --enable-checking (~3x slowdown reported
3529 by Juanma Barranquero <lekktu@gmail.com>).
3530 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3532 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3534 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3535 See <http://bugs.gnu.org/11825#29>.
3537 2012-07-08 Eli Zaretskii <eliz@gnu.org>
3539 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3540 has no font, use the frame's font. (Bug#11813)
3541 (display_line): Add commentary about displaying truncation glyphs
3543 (produce_special_glyphs): Move here from term.c.
3545 * term.c (produce_special_glyphs): Move to xdisp.c.
3547 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3550 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3552 * xdisp.c (display_line): Avoid warning about implicit declaration
3555 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3557 * lisp.h: Remove empty conditional.
3559 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3561 * lread.c (load_path_check): Now static.
3563 Fix some minor --with-ns problems found by static checking.
3564 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3565 (x_set_font) [!HAVE_X_WINDOWS]:
3566 * image.c (xpm_load_image) [HAVE_NS]:
3567 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3568 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3569 Remove unused local.
3570 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3571 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3572 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3573 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3574 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3575 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3576 Fix pointer signedness problem.
3577 * xfaces.c (FRAME_X_FONT_TABLE):
3578 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3580 2012-07-07 Glenn Morris <rgm@gnu.org>
3582 * lread.c (load_path_check): New function, split from init_lread.
3583 (init_lread): Reorganize. Motivation:
3584 If EMACSLOADPATH is set, check/warn about that rather than the
3585 defaults, which we are not going to use. Hence we can remove
3586 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3587 Don't warn if site-lisp directories are missing.
3588 If not installed, start from a blank load-path, since
3589 PATH_LOADSEARCH refers to the eventual installation directories.
3591 2012-07-07 Eli Zaretskii <eliz@gnu.org>
3593 Support truncation and continuation glyphs on GUI frames, when
3594 fringes are disabled. (Bug#11832)
3595 * xdisp.c (init_iterator): Get dimensions of truncation and
3596 continuation glyphs even if on GUI frames.
3597 Adjust it->last_visible_x on GUI frames when the left or right fringes,
3598 or both, are absent.
3599 (start_display, move_it_in_display_line_to): Handle the case of a
3600 GUI frame without a fringe to display continuation or truncation
3602 (insert_left_trunc_glyphs): Support GUI frames: make sure
3603 truncation glyphs overwrite enough glyphs from the current line to
3604 have sufficient space in pixels.
3605 (display_line): Support truncation and continuation glyphs on GUI
3606 frames. If some spare pixels are left on the line after inserting
3607 the truncation glyphs, fill that space with a stretch glyph of a
3608 suitably computed width.
3610 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3611 produce_glyphs, to support GUI sessions.
3613 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3615 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3617 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3619 Do not require float-time's arg to fit in time_t (Bug#11825).
3620 This works better on hosts where time_t is unsigned, and where
3621 float-time is applied to the (negative) difference between two times.
3622 * editfns.c (decode_time_components): Last arg is now double *,
3623 not int *, and means to store all the result as a double, without
3624 worrying about whether the seconds part fits in time_t.
3625 All callers changed.
3626 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3627 All callers changed.
3628 (Ffloat_time): Do not fail merely because the specified time falls
3629 outside of time_t range.
3631 2012-07-07 Glenn Morris <rgm@gnu.org>
3633 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3634 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3635 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3637 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
3639 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3640 Update dependencies.
3642 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3644 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3646 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3647 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3648 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3649 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3650 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3651 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3653 * xfont.c (compare_font_names): Redo to omit the need for casts.
3655 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3657 * xfns.c (Fx_change_window_property): Doc fix.
3658 * w32fns.c (Fx_change_window_property): Doc fix.
3660 * w32fns.c (Fx_window_property): Accept the same arguments as the
3661 X Windows version. Doc fix.
3662 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3664 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
3665 Eli Zaretskii <eliz@gnu.org>
3667 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3668 Windows-specific code from nt/config.nt moved here.
3669 Obsolete settings removed.
3671 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3673 * process.c: Avoid unnecessary calls to gettime.
3674 (wait_reading_process_output): Don't get the time of day
3675 when gobbling data immediately and not waiting, as there's no need
3676 for it in that case. This removes a FIXME.
3678 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3680 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3681 is defined (Bug#11768).
3683 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3685 Fix marker debugging code.
3686 * marker.c (byte_char_debug_check): Do not perform the check
3687 if buffer is not multibyte.
3688 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3689 Call byte_char_debug_check with correct arguments.
3691 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3693 Compile marker debugging code only if ENABLE_CHECKING is defined.
3694 * marker.c (byte_char_debug_check, count_markers):
3695 Use only if ENABLE_CHECKING is defined.
3696 (byte_debug_flag): Remove.
3697 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3698 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3700 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3702 Avoid code repetition in marker-related functions.
3703 * marker.c (attach_marker): New function.
3704 (Fset_marker, set_marker_restricted, set_marker_both)
3705 (set_marker_restricted_both): Use it.
3706 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3707 Consistently rename charno to charpos.
3708 (marker_position): Add eassert.
3709 (marker_byte_position): Convert to eassert.
3711 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3713 Simplify list operations in unchain_overlay and unchain_marker.
3714 * buffer.c (unchain_overlay): Simplify. Add comment.
3715 * marker.c (unchain_marker): Simplify. Fix comments.
3717 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3719 Introduce fast path for the widely used marker operation.
3720 * alloc.c (build_marker): New function.
3721 * lisp.h (build_marker): New prototype.
3722 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3723 * composite.c (autocmp_chars): Likewise.
3724 * editfns.c (buildmark): Remove.
3725 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3726 (save_restriction_save): Use build_marker.
3727 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3728 * window.c (save_window_save): Likewise.
3730 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3732 Do not use Fdelete_overlay in delete_all_overlays
3733 to avoid redundant calls to unchain_overlay.
3734 * buffer.c (drop_overlay): New function.
3735 (delete_all_overlays, Fdelete_overlay): Use it.
3736 * minibuf.c (get_minibuffer): Fix comment.
3738 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3740 Port to OpenBSD 5.1 amd64.
3741 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3742 This is needed for OpenBSD, and should be harmless on all BSD systems.
3743 Also, include <sys/sysctl.h>, as it should be available on all
3744 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3745 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3746 use p_pid member, not kp_proc.pid.
3748 2012-07-06 Glenn Morris <rgm@gnu.org>
3750 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3752 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3754 More xmalloc and related cleanup.
3755 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3756 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3757 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3758 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3759 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3760 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3761 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3762 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3763 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3765 Omit needless casts involving void * pointers and allocation.
3766 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3767 as the former is more robust if P's type is changed.
3768 Prefer xzalloc to xmalloc + memset 0.
3769 Simplify malloc-or-realloc to realloc.
3770 Don't worry about xmalloc returning a null pointer.
3771 Prefer xstrdup to xmalloc + strcpy.
3772 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3774 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3775 alloca of a constant.
3777 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3779 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3780 hscroll is larger than the line width. Fixes long and futile
3781 looping inside extend_face_to_end_of_line (on a TTY) producing
3782 glyphs that are not needed and thrown away.
3784 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3786 * marker.c (set_marker_restricted_both): Simplify by using
3789 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3791 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3793 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3795 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3796 not defined (Bug#11768).
3797 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3798 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3799 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3800 followed by gtk_box_set_homogeneous (Bug#11768).
3801 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
3802 (update_theme_scrollbar_width, xg_create_scroll_bar):
3803 Use gtk_scrollbar_new (Bug#11768).
3804 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3805 (is_box_type): New function (Bug#11768).
3806 (xg_tool_item_stale_p): Call is_box_type.
3807 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
3808 with default display (Bug#11768).
3810 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3812 * xdisp.c (window_hscroll_limited): New function.
3813 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3814 coordinates when window's hscroll is set to insanely large
3817 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
3819 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3820 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3822 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3825 * lisp.h (xzalloc): New prototype. Omit needless casts.
3826 * alloc.c (xzalloc): New function. Omit needless casts.
3827 * charset.c: Omit needless casts. Convert all calls to
3828 xmalloc with following memset to xzalloc.
3829 * dispnew.c: Likewise.
3830 * fringe.c: Likewise.
3831 * image.c: Likewise.
3832 * sound.c: Likewise.
3834 * w32fns.c: Likewise.
3835 * w32font.c: Likewise.
3836 * w32term.c: Likewise.
3837 * xfaces.c: Likewise.
3839 * xterm.c: Likewise.
3840 * atimer.c: Omit needless casts.
3841 * buffer.c: Likewise.
3842 * callproc.c: Likewise.
3844 * coding.c: Likewise.
3845 * composite.c: Likewise.
3847 * doprnt.c: Likewise.
3848 * editfns.c: Likewise.
3849 * emacs.c: Likewise.
3851 * filelock.c: Likewise.
3853 * gtkutil.c: Likewise.
3854 * keyboard.c: Likewise.
3856 * lread.c: Likewise.
3857 * minibuf.c: Likewise.
3858 * msdos.c: Likewise.
3859 * print.c: Likewise.
3860 * process.c: Likewise.
3861 * region-cache.c: Likewise.
3862 * search.c: Likewise.
3863 * sysdep.c: Likewise.
3864 * termcap.c: Likewise.
3865 * terminal.c: Likewise.
3866 * tparam.c: Likewise.
3867 * w16select.c: Likewise.
3869 * w32reg.c: Likewise.
3870 * w32select.c: Likewise.
3871 * w32uniscribe.c: Likewise.
3872 * widget.c: Likewise.
3873 * xdisp.c: Likewise.
3874 * xmenu.c: Likewise.
3876 * xselect.c: Likewise.
3878 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3880 * fileio.c (time_error_value): Check the right error number.
3881 Problem reported by Troels Nielsen in
3882 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3884 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3886 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3887 This should be fixed in a better way; see Eli Zaretskii in
3888 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3889 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3891 * fileio.c (time_error_value): Rename from special_mtime.
3892 The old name's problems were noted by Eli Zaretskii in
3893 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3895 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3896 This variable's comment says Emacs needs at least one GDB-visible
3897 symbol of type enum pvec_type, to work around GDB problems.
3898 The symbol's value doesn't matter.
3900 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3901 that causes compilation to fail on pre-C99 compilers.
3903 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
3905 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3906 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3908 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3910 * buffer.c (init_buffer_once): Fix initialization of
3911 headers for buffer_defaults and buffer_local_symbols.
3912 Reported by Juanma Barranquero <lekktu@gmail.com>.
3914 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3916 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3917 * lisp.h (enum pvec_type): Use fewer bits.
3918 (PSEUDOVECTOR_SIZE_BITS): New constant.
3919 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3920 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3921 change in pvec_type.
3922 (PSEUDOVECTOR_TYPEP): New macro.
3923 (TYPED_PSEUDOVECTORP): Use it.
3924 * fns.c (internal_equal): Adapt code to extract pvectype.
3925 * emacs.c (gdb_pvec_type): Update type.
3926 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3927 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3928 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3929 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3930 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3931 abusing vector->header.next.nbytes.
3932 (live_vector_p): Use PVEC_TYPE.
3933 (mark_object): Adapt code to extract pvectype. Use switch.
3935 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3937 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3938 Tighten new eassert a bit.
3940 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3942 Fix compilation with --enable-gcc-warnings and -O1
3944 * doprnt.c (doprnt): Change type of tem to int, initialize
3945 to avoid compiler warning. Add eassert.
3946 * search.c (simple_search): Initialize match_byte to avoid
3947 compiler warning. Add eassert.
3949 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3951 Avoid weird behavior with large horizontal scrolls.
3952 Without this change, for example, large hscroll values would
3953 mess up Emacs's display on Fedora 15 x86, presumably due to
3954 overflows in int calculations in the display code.
3955 Also, if buffers had long lines, Emacs would freeze.
3956 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3957 (set_window_hscroll): New function, containing the old guts of
3958 Fset_window_hscroll. Return the clipped value.
3959 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3960 This avoids the need to check against PTRDIFF_MAX.
3962 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3964 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3966 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3968 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3970 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3971 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3972 since GCC 4.4.6 issues a bogus warning for them.
3974 Fix bugs in file timestamp newness comparisons.
3975 * fileio.c (Ffile_newer_than_file_p):
3976 * lread.c (Fload): Use full timestamp resolution of files,
3977 not just the 1-second resolution, so that files that are only
3978 slightly newer still count as newer.
3979 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3980 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3982 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3984 * fileio.c: Improve handling of file time marker. (Bug#11852)
3985 (special_mtime): New function.
3986 (Finsert_file_contents, Fverify_visited_file_modtime):
3987 Use it to set special mtime values consistently.
3989 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3991 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3992 marker for non-existing file. (Bug#11852)
3994 2012-07-03 Glenn Morris <rgm@gnu.org>
3996 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3997 and did not make it into globals.h).
3999 2012-07-03 Tom Tromey <tromey@redhat.com>
4001 * window.c (Fset_window_margins, Fset_window_fringes)
4002 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4003 * textprop.c (Fprevious_property_change): No longer static.
4004 * syntax.c (Fsyntax_table_p): No longer static.
4005 * process.c (Fget_process, Fprocess_datagram_address): No longer
4007 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4008 * keyboard.c (Fcommand_execute): No longer static.
4010 * insdel.c (Fcombine_after_change_execute): No longer static.
4011 * image.c (Finit_image_library): No longer static.
4012 * fileio.c (Fmake_symbolic_link): No longer static.
4013 * eval.c (Ffetch_bytecode): No longer static.
4014 * editfns.c (Fuser_full_name): No longer static.
4015 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4017 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4019 * dired.c (Ffile_attributes): No longer static.
4020 * composite.c (Fcomposition_get_gstring): No longer static.
4021 * callproc.c (Fgetenv_internal): No longer static.
4023 * ccl.h: Remove EXFUNs.
4024 * buffer.h: Remove EXFUNs.
4025 * dispextern.h: Remove EXFUNs.
4026 * intervals.h: Remove EXFUNs.
4027 * fontset.h: Remove EXFUN.
4028 * font.h: Remove EXFUNs.
4029 * dosfns.c (system_process_attributes): Remove EXFUN.
4030 * keymap.h: Remove EXFUNs.
4031 * lisp.h: Remove EXFUNs.
4032 * w32term.h: Remove EXFUNs.
4033 * window.h: Remove EXFUNs.
4034 * xsettings.h: Remove EXFUN.
4035 * xterm.h: Remove EXFUN.
4037 2012-07-03 Glenn Morris <rgm@gnu.org>
4039 * lisp.h (Frandom): Make it visible to C.
4040 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4041 buffer for invisible buffers. (Bug#1229)
4043 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4045 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4046 values which aren't power of 2.
4047 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4048 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4051 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4053 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4055 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4057 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4059 * alloc.c (allocate_vector_block): Remove redundant
4060 calls to mallopt if DOUG_LEA_MALLOC is defined.
4061 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4062 avoid calls to mallopt if zero_vector is returned.
4064 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4066 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4067 is enabled, avoid dereferencing NULL current_sblock if
4070 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4072 Cleanup basic buffer management.
4073 * buffer.h (struct buffer): Change layout to use generic vector
4074 marking code. Fix some comments. Change type of 'clip_changed'
4075 to bitfield. Remove unused #ifndef old.
4076 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4077 (GET_OVERLAYS_AT): Fix indentation.
4078 (for_each_per_buffer_object_at): New macro.
4079 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4080 (Fbuffer_local_variables): Use it.
4081 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4082 * alloc.c (allocate_buffer): Adjust to match new layout of
4083 struct buffer. Fix comment.
4084 (mark_overlay): New function.
4085 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4086 Lisp area of struct buffer.
4087 (mark_object): Use it. Adjust marking of misc objects
4088 and related comments.
4090 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4092 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4093 wrapper that is not needed because the wrapped code is a no-op (zero
4094 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4095 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4097 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4099 * alloc.c (mark_buffer): Simplify. Remove prototype.
4100 (mark_object): Add comment. Reorganize marking of vector-like
4101 objects. Use CHECK_LIVE for all vector-like objects except buffers
4102 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4103 Avoid redundant calls to mark_vectorlike for bool vectors.
4105 2012-06-30 Glenn Morris <rgm@gnu.org>
4107 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4109 * epaths.in (PATH_SITELOADSEARCH): New.
4110 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4111 This is rather than relying on --enable-locallisppath elements
4112 having "site-lisp" in their names. (Bug#10208#25, 11658)
4114 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4116 * w32proc.c (sys_select): Accept and ignore one more argument.
4118 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4120 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4121 (pselect) [!MS_DOS]: Redirect to sys_select.
4123 * sysdep.c: Don't include dos.h and dosfns.h.
4125 * process.c (sys_select):
4126 * msdos.c (sys_select): Accept one more argument and ignore it.
4128 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4129 adapt data types and code to that.
4132 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4133 which clashes with the gnulib function of the same name.
4135 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4137 * font.c (font_style_to_value, font_style_symbolic)
4138 (font_prop_validate_style): Add type checks for values in
4141 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4143 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4146 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4148 * xdisp.c (try_window_id): Undo last change.
4150 * w32.c (getwd): Adjust commentary about startup_dir.
4151 (init_environment): Always call sys_access, even in non-MSVC
4152 builds. Don't chdir to the directory of the Emacs executable.
4153 This undoes code from 1997 which was justified by the need to
4154 "avoid conflicts when removing and renaming directories". But its
4155 downside was that every relative file name was being interpreted
4156 relative to the directory of the Emacs executable, which can never
4157 be TRT. In particular, it broke sys_access when called with
4158 relative file names.
4159 (sys_access): Map GetLastError to errno.
4161 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4163 * window.h (struct window): Change type of 'fringes_outside_margins'
4164 to bitfield. Fix comment. Adjust users accordingly.
4165 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4167 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4170 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4172 * gnutls.c (emacs_gnutls_handshake):
4173 Add QUIT to make the loop interruptible.
4175 2012-06-29 Glenn Morris <rgm@gnu.org>
4177 * charset.c (init_charset): Make lack of etc/charsets fatal.
4179 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4181 * editfns.c (region_limit): Fix type mismatch.
4183 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4185 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4186 undefined. Convert from xassert to eassert.
4187 * nsmenu.m: Convert from xassert to eassert.
4188 * nsterm.m: Likewise.
4190 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4192 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4194 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4196 Avoid integer overflow on scroll-left and scroll-right.
4197 * window.c (HSCROLL_MAX): New macro.
4198 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4199 overflow when requested scroll falls outside ptrdiff_t range.
4201 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4203 * window.h (struct window): Change type of 'hscroll',
4204 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4205 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4206 Adjust users accordingly.
4207 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4208 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4209 from EMACS_INT to ptrdiff_t.
4210 (make_window): Omit redundant initialization.
4212 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4214 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4216 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4218 * window.h (struct window): Change type of 'use_time' and
4219 'sequence_number' from Lisp_Object to int.
4220 * frame.c (make_frame): Adjust users accordingly.
4221 * print.c (print_object): Likewise.
4222 * window.c (select_window, Fwindow_use_time, make_parent_window)
4223 (make_window): Likewise.
4225 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4227 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4228 enabled with --enable-checking=[all,glyphs] configure option.
4229 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4230 adjust comments accordingly.
4231 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4232 undefined, adjust comments accordingly.
4233 * image.c: Likewise.
4234 * scroll.c: Likewise.
4235 * w32fns.c: Likewise.
4236 * w32term.c: Likewise.
4237 * xdisp.c: Likewise.
4238 * xfaces.c: Likewise.
4240 * xterm.c: Likewise.
4242 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4244 Generalize run-time debugging checks.
4245 * dispextern.h (XASSERTS): Remove.
4246 * fontset.c (xassert): Remove.
4247 Convert from xassert to eassert.
4248 * alloc.c: Convert from xassert to eassert.
4250 * dispnew.c: Likewise.
4252 * fringe.c: Likewise.
4253 * ftfont.c: Likewise.
4254 * gtkutil.c: Likewise.
4255 * image.c: Likewise.
4256 * keyboard.c: Likewise.
4258 * process.c: Likewise.
4259 * scroll.c: Likewise.
4260 * sound.c: Likewise.
4262 * w32console.c: Likewise.
4263 * w32fns.c: Likewise.
4264 * w32term.c: Likewise.
4265 * window.c: Likewise.
4266 * xdisp.c: Likewise.
4267 * xfaces.c: Likewise.
4269 * xselect.c: Likewise.
4270 * xterm.c: Likewise.
4272 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4274 * fns.c (maybe_resize_hash_table): Output message when growing the
4277 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4279 * alloc.c (allocate_string_data): Remove dead code.
4280 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4281 avoid GCC warning about unused macro.
4283 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4285 * alloc.c (allocate_string): Omit intervals initialization.
4286 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4287 as in make_pure_string and make_pure_c_string.
4289 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4291 * alloc.c (allocate_string): Fix last change.
4293 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4295 * alloc.c (allocate_string): Remove two redundant calls
4296 to memset, add explicit initialization where appropriate.
4298 2012-06-27 Glenn Morris <rgm@gnu.org>
4300 * lisp.mk (lisp): Remove paths.elc.
4302 2012-06-27 Chong Yidong <cyd@gnu.org>
4304 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4306 2012-06-26 John Wiegley <johnw@newartisans.com>
4308 * unexmacosx.c (copy_data_segment): Add two section names used
4309 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4311 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4312 when building with Clang.
4314 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4316 * eval.c (Fapply): Allow calling it with a single argument.
4318 2012-06-26 Eli Zaretskii <eliz@gnu.org>
4320 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4321 _stricmp and _strnicmp.
4322 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4324 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4326 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4328 (allocate_process): Likewise for new process.
4329 (allocate_terminal): Change to use offsetof.
4330 (allocate_frame): Likewise.
4331 * frame.c (make_frame): Omit redundant initialization.
4332 * window.c (make_parent_window): Use memset.
4333 (make_window): Omit redundant initialization.
4334 * process.c (make_process): Omit redundant initialization.
4335 * terminal.c (create_terminal): Likewise.
4337 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4339 * term.c (delete_tty): Remove redundant call to memset.
4341 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4343 * alloc.c: Remove build_string.
4344 * lisp.h: Define build_string as static inline. This provides
4345 a better opportunity to optimize away calls to strlen when the
4346 function is called with compile-time constant argument.
4347 * image.c (imagemagick_error): Convert to build_string.
4348 * w32proc.c (sys_spawnve): Likewise.
4349 * xterm.c (x_term_init): Likewise.
4351 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4353 Use sprintf return value instead of invoking strlen on result.
4354 In the old days this wasn't portable, since some sprintf
4355 implementations returned char *. But they died out years ago and
4356 Emacs already assumes sprintf returns int.
4357 Similarly for float_to_string.
4358 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4359 * ccl.c (ccl_driver):
4360 * character.c (string_escape_byte8):
4361 * data.c (Fnumber_to_string):
4362 * doprnt.c (doprnt):
4363 * print.c (print_object):
4364 * xdisp.c (message_dolog):
4365 * xfns.c (syms_of_xfns):
4366 Use sprintf or float_to_string result to avoid need to call strlen.
4367 * data.c (Fnumber_to_string):
4368 Use make_unibyte_string, since the string must be ASCII.
4369 * lisp.h, print.c (float_to_string): Now returns int length.
4370 * term.c (produce_glyphless_glyph):
4371 Use sprintf result rather than recomputing it.
4373 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4374 * Makefile.in (ALL_CFLAGS):
4375 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4376 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4378 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4380 * dispextern.h (xstrcasecmp): Define to library function
4381 strcasecmp if available.
4382 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4384 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4386 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4387 Avoid comma operator.
4388 * menu.c (push_submenu_start, push_submenu_end)
4389 (push_left_right_boundary, push_menu_pane): Likewise.
4390 * msdos.c (dos_rawgetc): Likewise.
4392 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4394 * xfns.c (xic_create_fontsetname): Remove redundant calls
4397 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4399 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4400 sprintf already null-terminates its output.
4402 * xfns.c (x_window): Remove redundant cast.
4404 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4406 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4407 `const char *' to `char *' to avoid compiler warning.
4409 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4411 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4412 instead of truncating it to 63 (admittedly a generous limit).
4414 * process.c: Fix spelling and caps in comments.
4416 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4418 * emacs.c (setpgrp): Remove definition, unused.
4419 * sysdep.c (setpgrp): Remove definition, not used in this file.
4421 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
4423 * makefile.w32-in: Update dependencies.
4425 2012-06-24 Eli Zaretskii <eliz@gnu.org>
4427 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4428 (SYSTIME_H): Add nt/inc/sys/time.h.
4430 * systime.h [WINDOWSNT]: Include sys/time.h.
4432 * s/ms-w32.h (struct timespec): Definition moved from
4433 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4435 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4437 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4438 * buffer.h (buffer_slot_type_mismatch):
4439 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4440 * eval.c (unwind_to_catch):
4441 * image.c (my_png_error, my_error_exit):
4442 * keyboard.c (quit_throw_to_read_char, user_error)
4443 (Fexit_recursive_edit, Fabort_recursive_edit):
4444 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4445 (wrong_type_argument, buffer_overflow, __executable_start)
4446 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4447 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4448 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4450 (child_setup) [!DOS_NT]:
4451 * lread.c (end_of_file_error, invalid_syntax):
4452 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4453 * puresize.h (pure_write_error):
4454 * search.c (matcher_overflow):
4455 * sound.c (sound_perror, alsa_sound_perror):
4456 * sysdep.c, syssignal.h (croak):
4457 * term.c (maybe_fatal, vfatal):
4458 * textprop.c (text_read_only):
4459 * undo.c (user_error):
4460 * unexmacosx.c (unexec_error):
4461 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4462 Use _Noreturn rather than NO_RETURN.
4463 No need for separate decl merely because of _Noreturn.
4464 * sound.c (sound_warning, parse_sound):
4465 Remove unnecessary forward decls.
4467 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4469 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4470 * lisp.h (WAIT_READING_MAX): New macro.
4471 * dispnew.c (Fsleep_for, sit_for):
4472 * keyboard.c (kbd_buffer_get_event):
4473 * process.c (Faccept_process_output):
4474 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4475 This improves on the previous patch, which introduced a bug
4476 when time_t is unsigned and as wide as intmax_t.
4477 See <http://bugs.gnu.org/9000#51>.
4479 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4481 * dispnew.c (sit_for, Fsleep_for):
4482 * keyboard.c (kbd_buffer_get_event):
4483 * process.c (Faccept_process_output): Avoid compiler warnings when
4484 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4486 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
4488 * makefile.w32-in: Update dependencies.
4490 * w32.c (ltime): Add return type and declare static.
4491 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4493 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4495 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4496 Privately reported by Herbert J. Skuhra.
4497 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4499 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4500 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4502 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4504 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4505 last argument of make_unibyte_string.
4507 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4508 language ID in the event parameters.
4510 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4511 event.code, not the obscure "character set ID".
4513 2012-06-23 Chong Yidong <cyd@gnu.org>
4515 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4517 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4519 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4520 * w32.c (fdutimens): New function.
4522 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4524 * s/ms-w32.h (pselect): Redirect to sys_select.
4526 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4528 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4529 in the logic of incrementing and decrementing the value of
4530 use_relocatable_buffers.
4532 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4534 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4535 Privately reported by Herbert J. Skuhra.
4536 [__FreeBSD__]: Remove "*/" typo after "#include".
4537 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4538 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4539 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4540 Don't assume EMACS_TIME and struct timeval are the same type.
4542 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4544 Support higher-resolution time stamps (Bug#9000).
4545 The time stamps are only nanosecond-resolution at the C level,
4546 since that's the best that any real-world system supports now.
4547 But they are picosecond-resolution at the Lisp level, as that's
4548 easy, and leaves room for future OS improvements.
4550 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4553 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4554 Don't get current time unless it's needed.
4556 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4557 now provides it if it's absent.
4558 (start_atimer): Port to higher-res time stamps.
4559 Check for time stamp overflow. Don't get current time more
4560 often than is needed.
4562 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4563 Include systime.h, not time.h.
4564 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4566 * dired.c: Include stat-time.h.
4567 (Ffile-attributes): File times now have higher resolution.
4569 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4570 (struct image): Timestamp now has higher resolution.
4572 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4573 has at least microseconds now. All uses removed.
4574 (update_frame, update_single_window, update_window, update_frame_1)
4575 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
4576 (duration_to_sec_usec): Remove; no longer needed.
4578 * editfns.c (time_overflow): Now extern.
4579 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4580 (float-time, Fformat_time_string, Fcurrent_time_string)
4581 (Fcurrent_time_zone): Accept and generate higher-resolution
4583 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4584 (decode_time_components, lisp_seconds_argument): New functions.
4585 (make_time): Now static.
4586 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4587 Report an error if the time is invalid, rather than having the caller
4590 * fileio.c: Include <stat-time.h>
4591 (Fcopy_file): Copy higher-resolution time stamps.
4592 Prefer to set the time stamp via a file descriptor if that works.
4593 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4594 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4595 (Fvisited_file_modtime, Fset_visited_file_modtime):
4596 Support higher-resolution time stamps.
4598 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4600 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4602 * image.c (prepare_image_for_display, clear_image_cache)
4603 (lookup_image): Port to higer-resolution time stamps.
4605 * keyboard.c (start_polling, bind_polling_period):
4606 Check for time stamp overflow.
4607 (read_char, kbd_buffer_get_event, timer_start_idle)
4608 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4609 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4610 Port to higher-resolution time stamps. Do not assume time_t is signed.
4611 (decode_timer): New function. Timers are now vectors of length 9,
4612 not 8, to accommodate the picosecond component.
4613 (timer_check_2): Use it.
4615 * nsterm.m (select_timeout, timeval_subtract): Remove.
4616 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4617 as they're a bit more accurate and handle overflow better.
4618 (ns_select): Change prototype to be compatible with pselect.
4619 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4620 * nsterm.h (ns_select): Adjust prototype.
4622 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4623 us-resolution time stamps.
4624 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4626 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4628 * lisp.h (time_overflow): New decl.
4629 (wait_reading_process_output): First arg is now intmax_t, not int,
4630 to accommodate larger waits.
4632 * process.h (struct Lisp_Process.read_output_delay):
4633 Now counts nanoseconds, not microseconds.
4634 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4636 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4637 (wait_reading_process_output):
4638 Port to ns-resolution time stamps.
4639 (Faccept_process_output, wait_reading_process_output):
4640 Check for time stamp overflow. Do not assume time_t is signed.
4641 (select_wrapper): Remove; we now use pselect.
4642 (Fprocess_attributes): Now generates ns-resolution time stamps.
4644 * sysdep.c: Include utimens.h. Don't include utime.h
4645 or worry about struct utimbuf; gnulib does that for us now.
4646 (gettimeofday): Remove; gnulib provides a substitute.
4647 (make_timeval): New function.
4648 (set_file_times): Now sets ns-resolution time stamps.
4649 New arg FD; all uses changed.
4650 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4651 (system_process_attributes):
4652 Now returns ns-resolution time stamp. All uses changed.
4653 Check for time stamp overflow.
4655 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4656 provides a substitute now.
4658 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4659 since it guarantees struct timespec.
4660 (EMACS_TIME): Now struct timespec, so that we can support
4661 ns-resolution time stamps.
4662 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4663 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4664 (EMACS_USECS): Remove.
4665 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4666 so multiply the arg by 1000 before storing it.
4667 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4669 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4670 Port to ns-resolution time stamps.
4671 (EMACS_TIME_NEG_P): Remove; replaced by....
4672 (EMACS_TIME_SIGN): New macro.
4673 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4674 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4675 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4676 (make_timeval, make_lisp_time, decode_time_components): New decls.
4677 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4678 that it mishandled time_t overflow. You can't compare by subtracting!
4679 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4680 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4682 * term.c: Include <sys/time.h>.
4683 (timeval_to_Time): New function, for proper overflow wraparound.
4684 (term_mouse_position, term_mouse_click): Use it.
4686 * undo.c (record_first_change): Support higher-resolution time stamps
4688 (Fprimitive_undo): Use them when restoring time stamps.
4690 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4691 (w32_get_internal_run_time):
4692 Port to higher-resolution Emacs time stamps.
4693 (ltime): Now accepts single 64-bit integer, as that's more convenient
4696 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4698 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4699 for compatibility with pselect. Support ns-resolution time stamps.
4701 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4703 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4704 Check for time stamp overflow, and support ns-resolution time stamps.
4706 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4707 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4708 (timeval_subtract): Remove; no longer needed.
4709 (XTflash, XTring_bell, x_wait_for_event):
4710 Port to ns-resolution time stamps. Don't assume time_t is signed.
4712 2012-06-22 Chong Yidong <cyd@gnu.org>
4714 * xdisp.c (x_consider_frame_title): Revert last change.
4716 2012-06-22 Eli Zaretskii <eliz@gnu.org>
4718 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4719 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4720 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4721 staticidx goes up to 1597 out of 1600 = 0x640.)
4723 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4725 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4726 Otherwise, the umask might be mistakenly 0 while handling input signals.
4728 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4730 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4732 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4734 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4735 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4736 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4737 access to `contents' member of Lisp_Vector objects with AREF and ASET
4740 2012-06-19 Chong Yidong <cyd@gnu.org>
4742 * frame.c (delete_frame): When selecting a frame on a different
4743 text terminal, do not alter the terminal's top-frame.
4745 * xdisp.c (format_mode_line_unwind_data): Record the target
4746 frame's selected window and its terminal's top-frame.
4747 (unwind_format_mode_line): Restore them.
4748 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4750 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4751 since tty frames can be explicitly named.
4752 (prepare_menu_bars): Likewise.
4754 * term.c (Ftty_top_frame): New function.
4756 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4758 Port byte-code-meter to modern targets.
4759 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4760 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
4761 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
4762 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4763 (METER_1, METER_2): Simplify.
4765 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4767 * data.c (Fdefalias): Return `symbol' (bug#11686).
4769 2012-06-18 Martin Rudalics <rudalics@gmx.at>
4771 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4772 gets killed during executing of this function (Bug#11665).
4773 Try to always return Qt when the buffer has been actually killed.
4774 (Vkill_buffer_query_functions): In doc-string say that functions
4775 run by this hook should not change the current buffer.
4777 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4779 Fix recently-introduced process.c problems found by static checking.
4780 * process.c (write_queue_push, write_queue_pop, send_process):
4781 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4782 (write_queue_pop): Fix pointer signedness problem.
4783 (send_process): Remove unused local.
4785 2012-06-17 Chong Yidong <cyd@gnu.org>
4787 * xdisp.c (redisplay_internal): No need to redisplay terminal
4788 frames that are not on top.
4790 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
4792 * process.c (make_process): Initialize write_queue.
4793 (write_queue_push, write_queue_pop): New functions.
4794 (send_process): Use them to maintain correct ordering of process
4797 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4799 * lisp.h (eassert): Assume C89 or later.
4800 This removes the need for CHECK.
4801 (CHECK): Remove. Its comments about always evaluating its
4802 argument were confusing, as 'eassert' typically does not evaluate
4805 * coding.c (produce_chars): Use ptrdiff_t, not int.
4807 * xterm.c (x_draw_underwave): Check for integer overflow.
4808 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4810 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
4812 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4813 referenced (Bug#11583).
4815 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4817 Implement wave-style variant of underlining.
4818 * dispextern.h (face_underline_type): New enum.
4819 (face): Add field for underline type.
4820 * nsterm.m (ns_draw_underwave): New function.
4821 (ns_draw_text_decoration): Use it.
4822 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4824 (x_draw_glyph_string): Use them.
4825 * xfaces.c (Qline, Qwave): New Lisp objects.
4826 (check_lface_attrs, merge_face_ref)
4827 (Finternal_set_lisp_face_attribute, realize_x_face):
4828 Handle wave-style underline face attributes.
4829 * xterm.c (x_draw_underwave): New function.
4830 (x_draw_glyph_string): Use it.
4832 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
4834 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4835 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4836 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4837 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4838 ($(BLD)/w32select.$(O)): Update dependencies.
4840 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4842 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4843 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4844 * character.c (_fetch_multibyte_char_p): Remove.
4845 * alloc.c: Include "character.h" before "buffer.h".
4847 * buffer.c: Likewise.
4848 * bytecode.c: Likewise.
4849 * callint.c: Likewise.
4850 * callproc.c: Likewise.
4851 * casefiddle.c: Likewise.
4852 * casetab.c: Likewise.
4853 * category.c: Likewise.
4855 * coding.c: Likewise.
4856 * composite.c: Likewise.
4857 * dired.c: Likewise.
4858 * dispnew.c: Likewise.
4860 * dosfns.c: Likewise.
4861 * editfns.c: Likewise.
4862 * emacs.c: Likewise.
4863 * fileio.c: Likewise.
4864 * filelock.c: Likewise.
4866 * fontset.c: Likewise.
4867 * fringe.c: Likewise.
4868 * indent.c: Likewise.
4869 * insdel.c: Likewise.
4870 * intervals.c: Likewise.
4871 * keyboard.c: Likewise.
4872 * keymap.c: Likewise.
4873 * lread.c: Likewise.
4874 * macros.c: Likewise.
4875 * marker.c: Likewise.
4876 * minibuf.c: Likewise.
4877 * nsfns.m: Likewise.
4878 * nsmenu.m: Likewise.
4879 * print.c: Likewise.
4880 * process.c: Likewise.
4881 * regex.c: Likewise.
4882 * region-cache.c: Likewise.
4883 * search.c: Likewise.
4884 * syntax.c: Likewise.
4886 * textprop.c: Likewise.
4888 * unexsol.c: Likewise.
4889 * w16select.c: Likewise.
4890 * w32fns.c: Likewise.
4891 * w32menu.c: Likewise.
4892 * window.c: Likewise.
4893 * xdisp.c: Likewise.
4895 * xmenu.c: Likewise.
4897 * xselect.c: Likewise.
4899 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4901 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4902 If all the glyphs of the glyph row came from strings, and we have no
4903 cursor positioning clues, put the cursor on the first glyph of the
4905 (handle_face_prop): Use chunk-relative overlay string index when
4906 indexing into it->string_overlays array. (Bug#11653)
4907 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4908 the rightmost. (Bug#11720)
4910 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4912 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4913 (CATEGORY_MEMBER): Enforce 1/0 value.
4914 * category.c (_temp_category_set): Remove.
4916 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4918 * window.c (Fdelete_other_windows_internal)
4919 (Fdelete_window_internal): Don't access frame's mouse highlight
4920 info of the initial frame. (Bug#11677)
4922 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4924 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4925 Assume USE_2_TAGS_FOR_INTS.
4926 (xreload): Adjust $tagmask width to match recent lisp.h change.
4928 Simplify lisp.h in minor ways that should not affect code.
4929 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4930 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4931 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4932 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4933 (INTTYPEBITS): New macro, for clarity.
4934 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
4935 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4936 Simplify now that USE_LSB_TAG is always defined.
4937 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4938 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4940 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
4942 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4944 2012-06-13 Glenn Morris <rgm@gnu.org>
4946 * s/bsd-common.h (BSD4_3):
4947 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4949 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4951 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4954 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4956 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
4957 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
4958 * alloc.c (widen_to_Lisp_Object): Remove.
4959 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4960 * frame.c (delete_frame): Remove outdated comment.
4961 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4962 USE_LISP_UNION_TYPE.
4963 (Fw32_unregister_hot_key): Likewise.
4964 (Fw32_toggle_lock_key): Likewise.
4965 * w32menu.c (add_menu_item): Likewise.
4966 (w32_menu_display_help): Use XIL instead of checking
4967 USE_LISP_UNION_TYPE.
4968 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4969 (init_heap): Likewise.
4970 * w32term.c (w32_read_socket): Update comment.
4972 2012-06-13 Glenn Morris <rgm@gnu.org>
4974 * s/usg5-4-common.h, src/s/unixware.h:
4975 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4977 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4979 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4981 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4982 * alloc.c (make_number) [!defined make_number]:
4983 Remove, as lisp.h always defines this now.
4984 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4985 (roundup_size): Verify that it is a power of 2.
4986 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4987 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4988 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4989 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4990 USE_LSB_TAG now is always defined to be either 0 or 1.
4992 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4993 code works fine either way, and efficiency is not a concern here,
4994 as the union type is for debugging, not for production.
4995 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4996 Use an inline function on all platforms when using the union type,
4997 since this is simpler and 'static inline' can be used portably
4999 (LISP_INITIALLY_ZERO): New macro.
5000 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5001 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5003 2012-06-12 Glenn Morris <rgm@gnu.org>
5005 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5007 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5009 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5010 Move BROKEN_SIGIO to configure.
5012 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5013 Move NO_TERMIO to configure.
5015 2012-06-12 Chong Yidong <cyd@gnu.org>
5017 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5018 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5019 MagickExportImagePixels is undefined.
5021 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5023 * image.c (imagemagick_load_image): Remove unused label.
5025 2012-06-11 Glenn Morris <rgm@gnu.org>
5027 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5028 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5029 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5030 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5032 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5034 * alloc.c (make_byte_code): New function.
5035 (Fmake_byte_code): Use it. Don't purify here.
5036 * lread.c (read1): Use it as well to avoid extra allocation.
5038 2012-06-11 Chong Yidong <cyd@gnu.org>
5040 * image.c (imagemagick_load_image): Implement transparency.
5042 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5044 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5045 account for preceding backslashes. (Bug#11663)
5047 2012-06-09 Chong Yidong <cyd@gnu.org>
5049 * term.c: Support italics in capable terminals (Bug#9652).
5050 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5051 (turn_on_face): Output using TS_enter_italic_mode if available.
5052 Don't handle unused blinking and alt-charset cases.
5053 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5054 and tty_alt_charset_p cases.
5055 (tty_capable_p, init_tty): Support italics.
5057 * termchar.h (struct tty_display_info): Add field for italics.
5058 Remove unused blink field.
5060 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5063 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5064 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5065 tty_alt_charset_p. Add tty_italic_p.
5067 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5069 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5070 dbus_type_is_basic if available.
5071 (xd_extract_signed, xd_extract_unsigned): Rename from
5072 extract_signed and extract_unsigned, respectively. Adapt callers.
5074 2012-06-09 Chong Yidong <cyd@gnu.org>
5076 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5078 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5081 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5083 * xdisp.c (vmessage): Treat frame message as multibyte.
5084 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5085 would generate the diagnostic "Making \302\247 buffer-local while
5088 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5090 * dispnew.c (showing_window_margins_p): Undo last change, which
5091 was done due to an inadvertent commit.
5092 (adjust_frame_glyphs_for_frame_redisplay): Do call
5093 showing_window_margins_p.
5095 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5097 * eval.c (Fmake_var_non_special): New primitive.
5098 (syms_of_eval): Defsubr it.
5099 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5101 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5103 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5104 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5106 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5108 * alloc.c (allocate_vectorlike): Fix last change.
5110 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5112 Block-based vector allocation of small vectors.
5113 * lisp.h (struct vectorlike_header): New field `nbytes',
5114 adjust comment accordingly.
5115 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5116 to denote vector blocks. Adjust users (live_vector_p,
5117 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5118 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5119 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5120 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5121 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5122 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5123 (roundup_size): New constant.
5124 (struct vector_block): New data type.
5125 (vector_blocks, vector_free_lists, zero_vector): New variables.
5126 (all_vectors): Rename to `large_vectors'.
5127 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5128 (sweep_vectors): New functions.
5129 (allocate_vectorlike): Return `zero_vector' as the only vector of
5130 0 items. Allocate new vector from block if vector size is less than
5131 or equal to VBLOCK_BYTES_MAX.
5132 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5133 (init_alloc_once): Add call to init_vectors.
5135 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5137 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5139 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5141 * doprnt.c (doprnt): Truncate multibyte char correctly.
5142 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5143 would mishandle a string argument "Xc" if X was a multibyte
5144 character of length 2: it would truncate after X's first byte
5145 rather than including all of X.
5147 2012-06-06 Chong Yidong <cyd@gnu.org>
5149 * buffer.c (word_wrap): Doc fix.
5151 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5153 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5155 2012-06-03 Glenn Morris <rgm@gnu.org>
5157 * xdisp.c (tool-bar-style): Doc fix.
5159 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5161 * Makefile.in (PAXCTL): Define.
5162 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5163 binary via PaX flags if the paxctl utility is available.
5164 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5165 Restore PaX flags to their default. (Bug#11398)
5167 2012-06-03 Chong Yidong <cyd@gnu.org>
5169 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5172 2012-06-03 Chong Yidong <cyd@gnu.org>
5174 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5175 (note_mode_line_or_margin_highlight): If there is no help echo,
5176 use mode-line-default-help-echo. Handle the case where the mouse
5177 position is past the end of the mode line string.
5179 * buffer.c (buffer_local_value_1): New function, split from
5180 Fbuffer_local_value; can return Qunbound.
5181 (Fbuffer_local_value): Use it.
5182 (Vmode_line_format): Docstring tweaks.
5184 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5186 * sysdep.c (system_process_attributes): Improve comment.
5188 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5190 * keyboard.c: Export real-this-command to Elisp.
5191 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5192 and DEFVAR it. Update all users.
5194 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5196 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5198 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5199 Convert pctcpu and pctmem to Lisp float properly.
5200 Let the compiler fold better, as 100.0/0x8000 is exact.
5202 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5204 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5207 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5209 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5211 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5213 For a 'struct window', replace some Lisp_Object fields to
5214 bitfields where appropriate, remove unused fields.
5215 * window.h (struct window): Remove unused 'last_mark_x' and
5216 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5217 change it's type from Lisp_Object to bitfield.
5218 Change type of 'force_start', 'optional_new_start',
5219 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5220 fields from Lisp_Object to bitfield. Adjust users accordingly.
5222 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5224 Pacify gcc -Wdouble-precision when using Xaw.
5225 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5226 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5227 Use 'float' consistently, rather than 'float' in most places
5228 and 'double' in a couple of places.
5230 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5232 * xdisp.c (handle_stop): Detect whether we have overlay strings
5233 loaded by testing it->current.overlay_string_index to be
5234 non-negative, instead of checking whether n_overlay_strings is
5235 positive. (Bug#11587)
5237 2012-05-31 Chong Yidong <cyd@gnu.org>
5239 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5241 * doc.c (Fsubstitute_command_keys): Doc fix.
5243 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5245 * search.c (search_buffer): Remove calls to
5246 r_alloc_inhibit_buffer_relocation, as it is now called by
5247 maybe_unify_char, which was the cause of relocation of buffer text
5250 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5252 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5253 for the duration of call to load_charset, to avoid problems with
5254 callers of maybe_unify_char that access buffer text through C
5257 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5258 decrement the inhibition flag, instead of just setting or
5261 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5263 Remove obsolete '#define static' cruft.
5264 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5265 This #undef was "temporary" in 2000; it is no longer needed
5266 now that '#define static' has gone away.
5267 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5268 (gray_bitmap_bits): Remove; no longer needed.
5269 All uses replaced with definiens.
5270 * xterm.c: Include "bitmaps/gray.xbm".
5272 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5274 Clean up __executable_start, monstartup when --enable-profiling.
5275 The following changes affect the code only when profiling.
5276 * dispnew.c (__executable_start): Rename from safe_bcopy.
5277 Define only on platforms that need it.
5278 * emacs.c: Include <sys/gmon.h> when profiling.
5279 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5280 (__executable_start): Remove decl, since lisp.h does it now.
5281 (safe_bcopy): Remove decl; no longer has that name.
5282 (main): Coalesce #if into single bit of code, for simplicity.
5283 Cast pointers to uintptr_t, since standard libraries want integers
5285 * lisp.h (__executable_start): New decl.
5287 2012-05-31 Glenn Morris <rgm@gnu.org>
5289 * image.c (Fimagemagick_types): Doc fix.
5291 2012-05-30 Jim Meyering <meyering@redhat.com>
5293 * callproc.c (Fcall_process_region): Include directory component
5294 in mkstemp error message (Bug#11586).
5296 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5298 * alloc.c, lisp.h (make_pure_vector): Now static.
5300 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5302 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5303 Move to byte-run.el.
5304 (Fautoload): Do the hash-doc more carefully.
5305 * data.c (Fdefalias): Purify definition, except for keymaps.
5306 (Qdefun): Move from eval.c.
5307 * lisp.h (Qdefun): Remove.
5308 * lread.c (read1): Tiny simplification.
5310 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
5312 Do not create empty overlays with the evaporate property (Bug#9642).
5313 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5314 Bug#9642, but explicitly check that the buffer the overlay would
5315 be moved to is live and rearrange lines to make sure that errors
5316 will not put the overlay in an inconsistent state.
5317 (Fdelete_overlay): Cosmetics.
5319 2012-05-28 Eli Zaretskii <eliz@gnu.org>
5321 * w32term.c (my_bring_window_to_top): New function.
5322 (x_raise_frame): Use handle returned by DeferWindowPos, which
5323 could be different from the original one.
5324 Call my_bring_window_to_top instead of my_set_foreground_window.
5327 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5328 by calling BringWindowToTop.
5330 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5331 (WM_EMACS_END): Increase by one.
5333 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5335 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5336 This avoids undefined behavior that might cause the eassert
5337 to not catch an out-of-range value.
5339 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
5341 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5342 Update dependencies.
5344 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5346 * bidi.c (bidi_mirror_char): Fix last change.
5348 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5350 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5351 when referring to sectname field in printf format.
5353 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5355 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5356 Only r_alloc_inhibit_buffer_relocation needed to be added;
5357 the others were already declared.
5359 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5360 before checking whether it's out of range. Put the check inside
5362 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5364 2012-05-27 Ken Brown <kbrown@cornell.edu>
5366 * callproc.c (Fcall_process): Restore a line that was accidentally
5367 commented out in the 2011-02-13 change (bug#11547).
5369 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5371 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5372 defined on ralloc.c.
5374 * buffer.c [REL_ALLOC]: Remove prototypes of
5375 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5376 they are now on lisp.h.
5378 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5380 * search.c (search_buffer): Use it to inhibit relocation of buffer
5381 text while re_search_2 is doing its job, because re_search_2 is
5382 passed C pointers to buffer text. (Bug#11519)
5384 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5387 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5388 state after an additional call to move_it_in_display_line_to, keep
5389 the values of it->max_ascent and it->max_descent found for the
5391 (pos_visible_p): Revert the comparison against bottom_y to what it
5392 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5395 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5397 Fix coding-related core dumps with gcc -ftrapv.
5398 The code was computing A - B, where A and B are pointers, and B is
5399 random garbage. This can lead to core dumps on platforms that
5400 have special pointer registers, and it also leads to core dumps on
5401 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5402 A - B only when B is initialized properly.
5403 * coding.c (coding_set_source, coding_set_destination): Return void.
5404 (coding_change_source, coding_change_destinations): New functions,
5405 with the old behaviors of coding_set_source and coding_set_destination.
5406 All callers that need an offset changed to use these new functions.
5408 2012-05-26 Glenn Morris <rgm@gnu.org>
5410 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5412 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5414 Extend mouse support on W32 text-mode console.
5415 * xdisp.c (draw_row_with_mouse_face):
5416 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
5418 * w32console.c: Include window.h.
5419 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5421 (initialize_w32_display): Initialize mouse-highlight data.
5423 * w32inevt.c: Include termchar.h and window.h.
5424 (do_mouse_event): Support mouse-autoselect-window. When the mouse
5425 moves, call note_mouse_highlight. If help_echo changed, call
5426 gen_help_event to produce help-echo message in the echo area.
5427 Call clear_mouse_face if mouse_face_hidden is set in the mouse
5430 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5432 * lread.c (read1): Simplify slightly to avoid an overflow warning
5433 with GCC 4.7.0 on x86-64.
5435 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5437 * bidi.c (bidi_mirror_char): Revert last change: an int is
5438 definitely wide enough here.
5440 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
5442 Fix integer width and related bugs (Bug#9874).
5443 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
5444 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5445 (string_bytes, check_sblock, allocate_string_data):
5446 (compact_small_strings, Fmake_bool_vector, make_string)
5447 (make_unibyte_string, make_multibyte_string)
5448 (make_string_from_bytes, make_specified_string)
5449 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5450 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5453 (allocate_pseudovector):
5454 Use int, not EMACS_INT, where int is wide enough.
5455 (inhibit_garbage_collection, Fgarbage_collect):
5456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5457 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5458 int might not be wide enough.
5459 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5460 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5461 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5462 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5463 (bidi_level_of_next_char, bidi_move_to_visually_next):
5464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5465 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5466 (Fkill_buffer, Fset_buffer_major_mode)
5467 (advance_to_char_boundary, Fbuffer_swap_text)
5468 (Fset_buffer_multibyte, overlays_at, overlays_in)
5469 (overlay_touches_p, struct sortvec, record_overlay_string)
5470 (overlay_strings, recenter_overlay_lists)
5471 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5472 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5473 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5474 (Foverlay_recenter, last_overlay_modification_hooks_used)
5475 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5477 (validate_region): Omit unnecessary test for b <= e,
5478 since that's guaranteed by the previous test.
5479 (adjust_overlays_for_delete): Avoid pos + length overflow.
5480 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5481 (report_overlay_modification):
5482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5483 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5484 Omit pointer cast, which isn't needed anyway, and doesn't work
5485 after the EMACS_INT -> ptrdiff_t change.
5486 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
5487 * buffer.h: Adjust decls to match defn changes elsewhere.
5488 (struct buffer_text, struct buffer):
5489 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5490 Use EMACS_INT, not int, where int might not be wide enough.
5491 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5492 not int, to avoid needless 32-bit limit on 64-bit hosts.
5493 (exec_byte_code): Use tighter memory-full test, one that checks
5494 for alloca overflow. Don't compute the address of the object just
5495 before an array, as that's not portable. Use EMACS_INT, not
5496 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
5497 * callint.c (Fcall_interactively):
5498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5499 * callproc.c (call_process_kill, Fcall_process):
5500 Don't assume pid_t fits into an Emacs fixnum.
5501 (call_process_cleanup, Fcall_process, child_setup):
5502 Don't assume pid_t fits into int.
5503 (call_process_cleanup, Fcall_process, delete_temp_file)
5504 (Fcall_process_region):
5505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5506 (Fcall_process): Simplify handling of volatile integers.
5507 Use int, not EMACS_INT, where int will do.
5508 * casefiddle.c (casify_object, casify_region, operate_on_word)
5509 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5510 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5511 (casify_object): Avoid integer overflow when overallocating buffer.
5512 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
5513 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
5514 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5515 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5516 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5517 integers are now checked earlier. All uses replaced with XINT.
5519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5520 For CCL_MapSingle, check that content and value are in int range.
5521 (ccl_driver, Fregister_code_conversion_map):
5522 Check that Vcode_version_map_vector is a vector.
5523 (resolve_symbol_ccl_program): Check that vector header is in range.
5524 Always copy the vector, so that we can check its contents reliably
5525 now rather than having to recheck each instruction as it's being
5526 executed. Check that vector words fit in 'int'.
5527 (ccl_get_compiled_code, Fregister_ccl_program)
5528 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5529 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5530 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5531 contents are in range.
5532 (Fccl_execute_on_string): Check that status is in range.
5533 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5534 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5535 Accept and return EMACS_INT, not int, because callers can pass values
5537 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5538 (multibyte_chars_in_text, parse_str_as_multibyte)
5539 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5540 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5541 (string_escape_byte8, Fget_byte):
5542 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5543 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
5544 avoid mishandling large integers.
5545 * character.h: Adjust decls to match defn changes elsewhere.
5546 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5547 (Ffind_charset_region):
5548 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5549 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5550 (load_charset_map_from_vector, Fdefine_charset_internal):
5551 Don't assume fixnum fits in int.
5552 (load_charset_map_from_vector, Fmap_charset_chars):
5553 Remove now-unnecessary CHECK_NATNUMs.
5554 (Fdefine_charset_internal): Check ranges here, more carefully.
5555 Don't rely on undefined behavior with signed left shift overflow.
5556 Don't assume unsigned int fits into fixnum, or that fixnum fits
5557 into unsigned int. Don't require max_code to be a valid fixnum;
5558 that's not true for gb10830 4-byte on a 32-bit host. Allow
5559 invalid_code to be a cons, for the same reason. Require code_offset
5560 to be a character. Avoid int overflow if max_char is close
5562 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5563 this is intended anyway and avoids some undefined behavior.
5564 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5565 INDEX_TO_CODE_POINT, as that's what it expects.
5566 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
5567 * charset.h (DECODE_CHAR): Return int, not unsigned;
5568 this is what was intended anyway, and it avoids undefined behavior.
5569 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5570 integer-overflow issues.
5571 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5572 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5573 where the argument is EMACS_INT, and this behavior is not intended.
5574 * chartab.c (Fmake_char_table, Fset_char_table_range)
5575 (uniprop_get_decoder, uniprop_get_encoder):
5576 Don't assume fixnum fits in int.
5577 * cmds.c (move_point): New function, that does the gist of
5578 Fforward_char and Fbackward_char, but does so while checking
5579 for integer overflow more accurately.
5580 (Fforward_char, Fbackward_char): Use it.
5581 (Fforward_line, Fend_of_line, internal_self_insert)
5582 (internal_self_insert):
5583 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5584 Fix a FIXME, by checking for integer overflow when calculating
5585 target_clm and actual_clm.
5586 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
5587 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
5588 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5589 (coding_alloc_by_making_gap, alloc_destination)
5590 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5591 (encode_coding_utf_16, detect_coding_emacs_mule)
5592 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5593 (detect_coding_iso_2022, decode_coding_iso_2022)
5594 (encode_invocation_designation, encode_designation_at_bol)
5595 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5596 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5597 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5598 (encode_coding_ccl, encode_coding_raw_text)
5599 (detect_coding_charset, decode_coding_charset)
5600 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5601 (produce_composition, produce_charset, produce_annotation)
5602 (decode_coding, handle_composition_annotation)
5603 (handle_charset_annotation, consume_chars, decode_coding_gap)
5604 (decode_coding_object, encode_coding_object, detect_coding_system)
5605 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5606 (code_convert_region, code_convert_string)
5607 (Fdefine_coding_system_internal)
5608 (coding_set_source, coding_set_destination):
5609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5610 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5611 (Fdefine_coding_system_internal):
5612 Don't assume fixnums fit in int.
5613 (decode_coding_gap, decode_coding_object, encode_coding_object)
5614 (Fread_coding_system, Fdetect_coding_region)
5615 (Funencodable_char_position, Fcheck_coding_systems_region)
5616 (get_translation, handle_composition_annotation, consume_chars):
5617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5618 (consume_chars): Rewrite to not calculate an address outside buffer.
5619 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
5620 Don't access memory outside of the args array.
5621 (Fdefine_coding_system_internal): Check for charset-id overflow.
5622 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5623 result of ENCODE_CHAR.
5624 * coding.h: Adjust decls to match defn changes elsewhere.
5625 (struct coding_system):
5626 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5627 * composite.c (get_composition_id, find_composition)
5628 (run_composition_function, update_compositions)
5629 (compose_text, composition_gstring_put_cache)
5630 (composition_gstring_p, composition_gstring_width)
5631 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5632 (composition_compute_stop_pos, composition_reseat_it)
5633 (composition_update_it, struct position_record)
5634 (find_automatic_composition, composition_adjust_point)
5635 (Fcomposition_get_gstring, Ffind_composition_internal):
5636 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5637 (update_compositions):
5638 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5639 * composite.h: Adjust decls to match defn changes elsewhere.
5640 (struct composition):
5641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5642 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5643 Do not attempt to compute the address of the object just before a
5644 buffer; this is not portable.
5646 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5647 (Faset): Use int, not EMACS_INT, where int is wide enough.
5648 (Fstring_to_number): Don't assume fixnums fit in int.
5649 (Frem): Don't assume arg is nonnegative.
5650 * dbusbind.c (xd_append_arg): Check for integers out of range.
5651 (Fdbus_call_method): Don't overflow the timeout int.
5652 (extract_signed, extract_unsigned): New functions.
5653 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5654 (xd_get_connection_references): Return ptrdiff_t, not int.
5656 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5657 (xd_read_message_1):
5658 Use int, not unsigned, where the dbus API uses int.
5659 (Fdbus_message_internal): Don't overflow mtype.
5660 (syms_of_dbusbind): Allocate right-sized buffer for integers.
5661 * dired.c (directory_files_internal, file_name_completion, scmp)
5662 (file_name_completion_stat):
5663 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5664 (file_name_completion): Don't overflow matchcount.
5665 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5666 * dispextern.h: Adjust decls to match defn changes elsewhere.
5667 (struct text_pos, struct glyph, struct bidi_saved_info)
5668 (struct bidi_string_data, struct bidi_it, struct composition_it)
5670 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5671 (struct display_pos, struct composition_it, struct it):
5672 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5673 * dispnew.c (increment_matrix_positions)
5674 (increment_row_positions, mode_line_string)
5675 (marginal_area_string):
5676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5677 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
5678 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5679 (duration_to_sec_usec): New function, to check for overflow better.
5680 (Fsleep_for, sit_for): Use it.
5681 * doc.c (get_doc_string, store_function_docstring):
5682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5683 (get_doc_string, Fsnarf_documentation):
5684 Use int, not EMACS_INT, where int is wide enough.
5686 Use SAFE_ALLOCA, not alloca.
5687 Check for overflow when converting EMACS_INT to off_t.
5688 * doprnt.c (doprnt):
5689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5690 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5691 Don't assume uid_t fits into fixnum.
5692 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5693 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5694 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5695 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5696 (general_insert_function)
5697 (Finsert_char, make_buffer_string, make_buffer_string_both)
5698 (update_buffer_properties, Fbuffer_substring)
5699 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5700 (Fsubst_char_in_region, check_translation)
5701 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5702 (transpose_markers, Ftranspose_regions):
5703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5704 (clip_to_bounds): Move to lisp.h as an inline function).
5705 (Fconstrain_to_field): Don't assume integers are nonnegative.
5706 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5707 (Fsubst_char_in_region, Fsave_restriction):
5708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5709 (Femacs_pid): Don't assume pid_t fits into fixnum.
5710 (lo_time): Use int, not EMACS_INT, when int suffices.
5711 (lisp_time_argument): Check for usec out of range.
5712 (Fencode_time): Don't assume fixnum fits in int.
5713 (Fuser_login_name, Fuser_full_name): Signal an error
5714 if a uid argument is out of range, rather than relying on
5716 (Fformat_time_string): Remove now-unnecessary check.
5717 lisp_time_argument checks for out-of-range usec now.
5718 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
5719 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5720 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5721 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5722 (init_cmdargs, Fdump_emacs):
5723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5724 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5725 the bottom (typically) 32 bits of the fixnum.
5726 * eval.c (specpdl_size, call_debugger):
5727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5728 (when_entered_debugger, Fbacktrace_debug):
5729 Don't assume fixnum can fit in int.
5730 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5731 the object just before a buffer; this is not portable.
5732 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5733 (grow_specpdl, unbind_to):
5734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5735 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5736 (grow_specpdl): Simplify allocation by using xpalloc.
5737 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
5738 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5739 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5741 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5743 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5744 (Fcopy_file, non_regular_nbytes, read_non_regular)
5745 (Finsert_file_contents):
5746 Use int, not EMACS_INT, where int is wide enough.
5747 (READ_BUF_SIZE): Verify that it fits in int.
5748 (Finsert_file_contents): Check that counts are in proper range,
5749 rather than assuming fixnums fit into ptrdiff_t etc.
5750 Don't assume fixnums fit into int.
5751 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5752 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5753 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
5754 (string_char_to_byte, string_byte_to_char)
5755 (string_make_multibyte, string_to_multibyte)
5756 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5757 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5758 (substring_both, Fdelete, internal_equal, Ffillarray)
5759 (Fclear_string, mapcar1)
5760 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5761 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5762 (larger_vector, make_hash_table, maybe_resize_hash_table)
5763 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5764 (Fmaphash, secure_hash):
5765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5766 (concat): Check for string index and length overflow.
5767 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5770 (larger_vector): New API (vec, incr_min, size_max) replaces old
5771 one (vec, new_size, init). This catches size overflow.
5772 INIT was removed because it was always Qnil.
5773 All callers changed.
5774 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5775 the upper bound on a hash table index size.
5776 (make_hash_table, maybe_resize_hash_table): Use it.
5777 (secure_hash): Computer start_byte and end_byte only after
5778 they're known to be in ptrdiff_t range.
5779 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5780 (Ffont_get_glyphs, Ffont_at):
5781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5782 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5783 (Flist_fonts, Fopen_font):
5784 Don't assume fixnum can fit in int.
5785 (check_gstring): Don't assume index can fit in int.
5786 (font_match_p): Check that fixnum is a character, not a nonnegative
5787 fixnum, since the later code needs to stuff it into an int.
5788 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5789 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5790 conversion overflow issues.
5791 (Fopen_font): Check for integer out of range.
5792 (Ffont_get_glyphs): Don't assume index can fit in int.
5793 * font.h: Adjust decls to match defn changes elsewhere.
5794 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5796 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5797 printmax_t, where ptrdiff_t is wide enough.
5798 (Finternal_char_font):
5799 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5800 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5801 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5802 (Fset_frame_position, x_set_frame_parameters)
5803 (x_set_line_spacing, x_set_border_width)
5804 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5805 Check that fixnums are in proper range for system types.
5806 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5808 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5809 Use SAFE_ALLOCA_LISP, not alloca.
5810 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5811 intptr_t is wide enough.
5812 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5813 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5814 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5815 Check for fixnum out of range.
5816 * ftfont.c (ftfont_list): Don't assume index fits in int.
5817 Check that fixnums are in proper range for system types.
5818 (ftfont_shape_by_flt):
5819 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5820 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5822 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5823 Check that fixnums are in proper range for system types.
5824 * gnutls.h: Adjust decls to match defn changes elsewhere.
5825 * gtkutil.c (xg_dialog_run):
5826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5827 (update_frame_tool_bar):
5828 Check that fixnums are in proper range for system types.
5829 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5830 (lookup_image): Check that fixnums are in range for system types.
5831 * indent.c (last_known_column, last_known_column_point):
5832 (current_column_bol_cache):
5833 (skip_invisible, current_column, check_display_width):
5834 (check_display_width, scan_for_column, current_column_1)
5835 (Findent_to, Fcurrent_indentation, position_indentation)
5836 (indented_beyond_p, Fmove_to_column, compute_motion):
5837 (Fcompute_motion, Fvertical_motion):
5838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5839 (last_known_column_modified): Use EMACS_INT, not int.
5840 (check_display_width):
5842 Check that fixnums and floats are in proper range for system types.
5843 (compute_motion): Don't assume index or fixnum fits in int.
5844 (compute_motion, Fcompute_motion):
5845 Use int, not EMACS_INT, when it is wide enough.
5846 (vmotion): Omit local var start_hpos that is always 0; that way
5847 we don't need to worry about overflow in expressions involving it.
5848 * indent.h: Adjust decls to match defn changes elsewhere.
5850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5851 Use int, not EMACS_INT, where int is wide enough.
5852 Remove unused members ovstring_chars_done and tab_offset;
5854 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5855 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5856 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5857 (make_gap, copy_text, insert, insert_and_inherit)
5858 (insert_before_markers, insert_before_markers_and_inherit)
5859 (insert_1, count_combining_before, count_combining_after)
5860 (insert_1_both, insert_from_string)
5861 (insert_from_string_before_markers, insert_from_string_1)
5862 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5863 (adjust_after_replace, adjust_after_insert, replace_range)
5864 (replace_range_2, del_range, del_range_1, del_range_byte)
5865 (del_range_both, del_range_2, modify_region)
5866 (prepare_to_modify_buffer, signal_before_change)
5867 (signal_after_change, Fcombine_after_change_execute):
5868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5869 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5870 (balance_an_interval, split_interval_right, split_interval_left)
5871 (find_interval, next_interval, update_interval)
5872 (adjust_intervals_for_insertion, delete_node, delete_interval)
5873 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5874 (static_offset_intervals, offset_intervals)
5875 (merge_interval_right, merge_interval_left, make_new_interval)
5876 (graft_intervals_into_buffer, temp_set_point_both)
5877 (temp_set_point, set_point, adjust_for_invis_intang)
5878 (set_point_both, move_if_not_intangible, get_property_and_range)
5879 (get_local_map, copy_intervals, copy_intervals_to_string)
5880 (compare_string_intervals, set_intervals_multibyte_1):
5881 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5882 * intervals.h: Adjust decls to match defn changes elsewhere.
5884 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5885 * keyboard.c (this_command_key_count, this_single_command_key_start)
5886 (before_command_key_count, before_command_echo_length, echo_now)
5887 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5888 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5889 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5890 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5892 (last_non_minibuf_size, last_point_position, echo_truncate)
5893 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5894 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5895 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5896 (stuff_buffered_input):
5897 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5898 (last_auto_save, command_loop_1, read_char):
5899 Use EMACS_INT, not int, to avoid integer overflow.
5900 (record_char): Avoid overflow in total_keys computation.
5901 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5902 * keyboard.h: Adjust decls to match defn changes elsewhere.
5903 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5904 (Fkey_description, Fdescribe_vector, Flookup_key):
5905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5906 (click_position): New function, to check that positions are in range.
5907 (Fcurrent_active_maps):
5909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5910 (Faccessible_keymaps, Fkey_description):
5911 (preferred_sequence_p):
5912 Don't assume fixnum can fit into int.
5913 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5914 Check for integer overflow in size calculations.
5915 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5916 avoid mishandling large integers.
5917 * lisp.h: Adjust decls to match defn changes elsewhere.
5918 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5919 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5920 (struct Lisp_Marker):
5921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5922 (clip_to_bounds): Now an inline function, moved here from editfns.c.
5923 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5924 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5925 All callers changed.
5926 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5927 Assume the arg has valid form, since it always does.
5928 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5929 unsigned integer system type.
5930 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5931 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5932 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5933 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5934 (duration_to_sec_usec): New decl.
5935 * lread.c (read_from_string_index, read_from_string_index_byte)
5936 (read_from_string_limit, readchar, unreadchar, openp)
5937 (read_internal_start, read1, oblookup):
5938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5939 (Fload, readevalloop, Feval_buffer, Feval_region):
5940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5941 (openp): Check for out-of-range argument to 'access'.
5942 (read1): Use int, not EMACS_INT, where int is wide enough.
5943 Don't assume fixnum fits into int.
5944 Fix off-by-one error that can read outside a buffer.
5945 (read_filtered_event): Use duration_to_sec_usec
5946 to do proper overflow checking on durations.
5947 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5948 in size calculation.
5949 (Fexecute_kbd_macro):
5950 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5951 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5952 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5953 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5954 (set_marker_both, set_marker_restricted_both, marker_position)
5955 (marker_byte_position, Fbuffer_has_markers_at):
5956 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5957 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
5958 * menu.c (ensure_menu_items): Rename from grow_menu_items.
5959 It now merely ensures that the menu is large enough, without
5960 necessarily growing it, as this avoids some integer overflow issues.
5961 All callers changed.
5962 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5963 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5964 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5965 Use SAFE_ALLOCA_LISP, not alloca.
5966 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5967 to EMACS_INT. Check that fixnums are in proper range for system types.
5968 * minibuf.c (minibuf_prompt_width, string_to_object)
5969 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5970 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5971 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5972 (get_minibuffer, read_minibuf_unwind):
5973 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5974 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5975 this simplifies overflow checking. All callers changed.
5976 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5978 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5979 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5980 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5981 Check that fixnums are in proper range for system types.
5982 (Fx_create_frame, Fx_show_tip):
5983 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5984 * nsfont.m (ns_findfonts, nsfont_list_family):
5985 Don't assume fixnum fits in long.
5986 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5988 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5990 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
5991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5992 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5993 (PRINTDECLARE, PRINTPREPARE):
5994 (strout, print_string):
5995 (print, print_preprocess, print_check_string_charset_prop)
5997 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5999 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6001 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6002 (printchar, strout): Use xpalloc to catch size calculation overflow.
6003 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6004 (print_error_message): Use SAFE_ALLOCA, not alloca.
6005 (print_object): Use int, not EMACS_INT, where int is wide enough.
6006 (print_depth, new_backquote_output, print_number_index):
6007 Use ptrdiff_t, not int, where int might not be wide enough.
6008 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6009 (Fset_process_window_size, Fformat_network_address)
6010 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6012 Check that fixnums are in proper range for system types.
6013 (Fsignal_process): Simplify by avoiding a goto.
6014 Check for process-ids out of pid_t range rather than relying on
6016 (process_tick, update_tick): Use EMACS_INT, not int.
6017 (Fformat_network_address, read_process_output, send_process)
6018 (Fprocess_send_region, status_notify):
6019 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6020 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6021 (wait_reading_process_output, read_process_output, exec_sentinel):
6022 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6023 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6024 (Faccept_process_output): Use duration_to_sec_usec to do proper
6025 overflow checking on durations.
6026 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6027 Don't assume pid_t fits in int.
6028 * process.h (struct Lisp_Process): Members tick and update_tick
6029 are now of type EMACS_INT, not int.
6030 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6031 configured --with-wide-int.
6032 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6033 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6034 * search.c (looking_at_1, string_match_1):
6035 (fast_string_match, fast_c_string_match_ignore_case)
6036 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6037 (scan_newline, find_before_next_newline, search_command)
6038 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6039 (set_search_regs, wordify):
6042 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6043 (string_match_1, search_buffer, set_search_regs):
6045 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6046 (wordify): Check for overflow in size calculation.
6047 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6048 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6049 Check that fixnums are in proper range for system types.
6050 * sound.c (struct sound_device)
6051 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6052 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6053 (Fplay_sound_internal):
6054 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6055 * syntax.c (struct lisp_parse_state, find_start_modiff)
6056 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6057 (Fparse_partial_sexp):
6058 Don't assume fixnums can fit in int.
6059 (struct lisp_parse_state, find_start_pos, find_start_value)
6060 (find_start_value_byte, find_start_begv)
6061 (update_syntax_table, char_quoted, dec_bytepos)
6062 (find_defun_start, prev_char_comend_first, back_comment):
6063 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6064 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6065 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6066 (Finternal_describe_syntax_value): Check that match_lisp is a
6067 character, not an integer, since the code stuffs it into int.
6068 (scan_words, scan_sexps_forward):
6069 Check that fixnums are in proper range for system types.
6071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6072 (scan_sexps_forward):
6073 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6074 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6075 * syntax.h: Adjust decls to match defn changes elsewhere.
6076 (struct gl_state_s):
6077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6078 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6079 MOST_POSITIVE_FIXNUM.
6080 * sysdep.c (wait_for_termination_1, wait_for_termination)
6081 (interruptible_wait_for_termination, mkdir):
6082 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6083 (emacs_read, emacs_write):
6084 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6085 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6086 and double all fit in int.
6087 * term.c (set_tty_color_mode):
6088 Check that fixnums are in proper range for system types.
6089 * termhooks.h (struct input_event):
6090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6091 * textprop.c (validate_interval_range, interval_of)
6092 (Fadd_text_properties, set_text_properties_1)
6093 (Fremove_text_properties, Fremove_list_of_text_properties)
6094 (Ftext_property_any, Ftext_property_not_all)
6095 (copy_text_properties, text_property_list, extend_property_ranges)
6096 (verify_interval_modification):
6097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6098 (Fnext_single_char_property_change)
6099 (Fprevious_single_char_property_change):
6100 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6101 (copy_text_properties):
6102 Check for integer overflow in index calculation.
6103 * undo.c (last_boundary_position, record_point, record_insert)
6104 (record_delete, record_marker_adjustment, record_change)
6105 (record_property_change):
6106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6107 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6109 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6110 (Fx_hide_tip, Fx_file_dialog):
6111 * w32menu.c (set_frame_menubar):
6112 Use ptrdiff_t, not int, for consistency with rest of code.
6113 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6114 (select_window, Fdelete_other_windows_internal)
6115 (window_scroll_pixel_based, window_scroll_line_based)
6116 (Frecenter, Fset_window_configuration):
6117 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6118 (Fset_window_hscroll, run_window_configuration_change_hook)
6119 (set_window_buffer, temp_output_buffer_show, scroll_command)
6120 (Fscroll_other_window, Frecenter):
6121 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6122 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6123 Don't assume fixnum fits in int.
6124 (Fset_window_scroll_bars):
6125 Check that fixnums are in proper range for system types.
6126 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6127 (string_pos, c_string_pos, number_of_chars, init_iterator)
6128 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6129 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6130 (compute_display_string_end, handle_face_prop)
6131 (face_before_or_after_it_pos, handle_invisible_prop)
6132 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6133 (display_prop_intangible_p, string_buffer_position_lim)
6134 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6135 (get_overlay_strings_1, get_overlay_strings)
6136 (iterate_out_of_display_property, forward_to_next_line_start)
6137 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6138 (get_next_display_element, set_iterator_to_next)
6139 (get_visually_first_element, compute_stop_pos_backwards)
6140 (handle_stop_backwards, next_element_from_buffer)
6141 (move_it_in_display_line_to, move_it_in_display_line)
6142 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6143 (add_to_log, message_dolog, message_log_check_duplicate)
6144 (message2, message2_nolog, message3, message3_nolog
6145 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6146 (current_message_1, truncate_echo_area, truncate_message_1)
6147 (set_message, set_message_1, store_mode_line_noprop)
6148 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6149 (text_outside_line_unchanged_p, check_point_in_composition)
6150 (reconsider_clip_changes)
6151 (redisplay_internal, set_cursor_from_row, try_scrolling)
6152 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6153 (redisplay_window, find_last_unchanged_at_beg_row)
6154 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6155 (trailing_whitespace_p, find_row_edges, display_line)
6156 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6157 (display_mode_element, store_mode_line_string)
6158 (pint2str, pint2hrstr, decode_mode_spec)
6159 (display_count_lines, display_string, draw_glyphs)
6160 (x_produce_glyphs, x_insert_glyphs)
6161 (rows_from_pos_range, mouse_face_from_buffer_pos)
6162 (fast_find_string_pos, mouse_face_from_string_pos)
6163 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6164 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6165 (safe_call, init_from_display_pos, handle_fontified_prop)
6166 (handle_single_display_spec, load_overlay_strings)
6167 (with_echo_area_buffer, setup_echo_area_for_printing)
6168 (display_echo_area, echo_area_display)
6169 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6170 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6171 (redisplay_window, dump_glyph_row, display_mode_line)
6172 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6173 (handle_display_spec, display_prop_string_p):
6174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6175 (handle_single_display_spec, build_desired_tool_bar_string)
6176 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6177 (get_specified_cursor_type):
6178 Check that fixnums are in proper range for system types.
6179 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6180 (Flookup_image_map):
6181 Don't assume fixnums fit in int.
6182 (compare_overlay_entries):
6183 Avoid mishandling comparisons due to subtraction overflow.
6184 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6185 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6186 (handle_tool_bar_click):
6187 Use int, not unsigned, since we prefer signed and the signedness
6188 doesn't matter here.
6189 (get_next_display_element, next_element_from_display_vector):
6190 Use int, not EMACS_INT, when int is wide enough.
6191 (start_hourglass): Use duration_to_sec_usec to do proper
6192 overflow checking on durations.
6193 * xfaces.c (Fbitmap_spec_p):
6194 Check that fixnums are in proper range for system types.
6195 (compare_fonts_by_sort_order):
6196 Avoid mishandling comparisons due to subtraction overflow.
6197 (Fx_family_fonts, realize_basic_faces):
6198 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6200 Don't assume fixnum fits in int.
6201 Use SAFE_ALLOCA_LISP, not alloca.
6202 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6203 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6204 (face_at_buffer_position, face_for_overlay_string)
6205 (face_at_string_position):
6206 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6207 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6208 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6210 Check that fixnums are in proper range for system types.
6211 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6212 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6214 (Fx_change_window_property): Don't assume fixnums fit in int.
6215 * xfont.c (xfont_chars_supported):
6216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6217 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6218 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6219 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6220 * xml.c (parse_region):
6221 * xrdb.c (magic_file_p):
6222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6223 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6224 (x_get_local_selection, x_reply_selection_request)
6225 (x_handle_selection_request, wait_for_property_change):
6226 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6227 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6228 short is wide enough.
6229 (x_send_client_event): Don't assume fixnum fits in int.
6230 * xterm.c (x_x_to_emacs_modifiers):
6231 Don't assume EMACS_INT overflows nicely into int.
6232 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6234 (handle_one_xevent): NATNUMP can eval its arg twice.
6235 (x_connection_closed):
6236 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6237 * xterm.h: Adjust decls to match defn changes elsewhere.
6238 (struct scroll_bar): Use struct vectorlike_header
6239 rather than rolling our own approximation.
6240 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6242 2012-05-25 Glenn Morris <rgm@gnu.org>
6244 * lisp.mk (lisp): Update for more files being compiled now.
6246 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6248 * lread.c: Remove `read_pure' which makes no difference.
6249 (read_pure): Remove var.
6250 (unreadpure): Remove function.
6251 (readevalloop): Don't call read_list with -1 flag.
6252 (read1, read_vector): Don't test read_pure any more.
6253 (read_list): Simplify.
6255 * fileio.c, character.h: Minor style tweaks.
6257 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6259 * window.h (clip_changed): Remove useless declaration.
6261 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6263 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6264 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6266 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6269 This directory predates autoconf and is no longer needed nowadays.
6270 Move its few remaining bits of functionality to where they're needed.
6271 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6272 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6273 * m/template.h: Remove.
6274 * Makefile.in (M_FILE): Remove. All uses removed.
6275 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6276 * lisp.h (USE_LSB_TAG):
6277 * mem-limits.h (EXCEEDS_LISP_PTR):
6278 Use VAL_MAX, not VALBITS, in #if.
6279 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6280 (EMACS_UINT): Define unconditionally now.
6281 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6282 (BITS_PER_EMACS_INT): New constants, replacing
6283 what used to be in config.h, but not useful in #if.
6284 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6285 define them any more.
6286 (VAL_MAX): New macro.
6288 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6289 BITS_PER_EMACS_INT, in #if.
6290 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6291 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6292 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6293 * s/ms-w32.h (DATA_START):
6294 Move here from removed file m/intel386.h.
6295 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6296 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6298 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6300 Assume C89 or later.
6301 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6302 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6304 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6305 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6306 * textprop.c, tparam.c (NULL): Remove.
6307 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6308 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6309 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6310 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6311 * xterm.c (input_signal_count): Assume volatile works.
6313 2012-05-21 Ken Brown <kbrown@cornell.edu>
6315 * xgselect.c (xg_select): Fix first argument in call to 'select'
6318 2012-05-20 Ken Brown <kbrown@cornell.edu>
6320 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6321 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6323 2012-05-19 Ken Brown <kbrown@cornell.edu>
6325 * xfns.c (x_in_use): Remove `static' qualifier.
6326 * xterm.h (x_in_use): Declare.
6327 * xgselect.c: Include xterm.h.
6328 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6329 and `display_arg' (bug#9754).
6331 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6333 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6335 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6336 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6338 2012-05-18 Eli Zaretskii <eliz@gnu.org>
6340 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6342 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6343 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6345 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6346 reference to image_cache->refcount.
6347 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6349 2012-05-17 Juri Linkov <juri@jurta.org>
6351 * search.c (Fword_search_regexp, Fword_search_backward)
6352 (Fword_search_forward, Fword_search_backward_lax)
6353 (Fword_search_forward_lax): Move functions to isearch.el
6354 (bug#10145, bug#11381).
6356 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6358 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6360 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6362 * lread.c (init_obarray): Declare Qt and Qnil as special.
6364 2012-05-14 Glenn Morris <rgm@gnu.org>
6366 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6367 Put "libexec" before "bin", for the sake of init_callproc_1.
6369 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6371 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6373 * unexaix.c: Port to more-recent AIX compilers.
6374 (report_error, report_error_1, make_hdr, copy_sym)
6375 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6376 Make arguments const char *, not char *, to avoid violations of C
6377 standard and to fix some AIX warnings reported by Gilles Pion.
6379 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6381 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6382 already have overlays loaded.
6383 (handle_single_display_spec): Before returning without displaying
6384 fringe bitmap, synchronize the bidi iterator with the main display
6385 iterator, by calling iterate_out_of_display_property.
6386 (iterate_out_of_display_property): Detect buffer iteration by
6387 testing that it->string is a Lisp string.
6388 (get_next_display_element): When the current object is exhausted,
6389 and there's something on it->stack, call set_iterator_to_next to
6390 proceed with what's on the stack, instead of returning zero.
6391 (set_iterator_to_next): If called at the end of a Lisp string,
6392 proceed to consider_string_end without incrementing string
6393 position. Don't increment display vector index past the end of
6394 the display vector. (Bug#11417)
6395 (pos_visible_p): Don't report a position visible when move_it_to
6396 stopped at the last line of window, which happens to be scanned
6397 backwards by the bidi iteration. (Bug#11464)
6399 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6401 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6402 and right-margin display specs even if the spec is invalid or we
6403 are on a TTY, and thus unable to display on the fringes.
6404 That's because the text with the property will not be displayed anyway,
6405 so we need to signal to the caller that this is a "replacing"
6406 display spec. This fixes display when the spec is invalid or we
6409 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6411 * unexaix.c (make_hdr): Fix typo in prototype.
6412 This bug broke the build on AIX. Problem reported by Gilles Pion.
6414 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
6416 * keyboard.c (kbd_buffer_get_event): Read special events also in
6417 batch mode. (Bug#11415)
6419 2012-05-12 Glenn Morris <rgm@gnu.org>
6421 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6423 2012-05-12 Eli Zaretskii <eliz@gnu.org>
6425 * lisp.mk (lisp): Add newcomment.elc.
6427 2012-05-12 Glenn Morris <rgm@gnu.org>
6429 * Makefile.in (MKDIR_P): New, set by configure.
6430 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6432 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6434 Remove unused function hourglass_started.
6435 * dispextern.h (hourglass_started):
6436 * w32fns.c (hourglass_started):
6437 * xdisp.c (hourglass_started): Remove.
6439 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
6441 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6442 Update dependencies.
6444 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6446 * xgselect.c (xg_select): Put maxfds+1 into a var.
6447 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6449 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6451 2012-05-10 Dave Abrahams <dave@boostpro.com>
6453 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6454 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6456 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
6458 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6459 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6460 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6461 Initialize xd_registered_buses.
6463 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6465 Untag more efficiently if USE_LSB_TAG.
6466 This is based on a proposal by YAMAMOTO Mitsuharu in
6467 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6468 For an admittedly artificial (nth 8000 longlist) benchmark on
6469 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6470 Emacs's overall text size by 1%.
6471 * lisp.h (XUNTAG): New macro.
6472 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6473 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6474 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6475 * eval.c (Fautoload):
6476 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6477 * frame.h (XFRAME): Use XUNTAG.
6479 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6480 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6481 Remove unportable assumptions about print widths of types like
6483 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6484 intptr_t when converting between pointer and integer, to avoid GCC
6485 warnings about wrong width.
6487 2012-05-09 Eli Zaretskii <eliz@gnu.org>
6489 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6490 stack for each reader_thread, instead of defaulting to 8MB
6491 determined by the linker. This avoids failures in creating
6492 subprocesses on Windows 7, see the discussion in this thread:
6493 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6495 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6497 Fix up display of the *Minibuf-0* buffer in the mini window.
6498 * keyboard.c (read_char): Don't clear the echo area if there's no
6500 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
6501 contents of *Minibuf-0*) if there's no message displayed in its stead.
6503 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
6505 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6508 2012-05-06 Chong Yidong <cyd@gnu.org>
6510 * lisp.mk (lisp): Update.
6512 2012-05-05 Jim Meyering <meyering@redhat.com>
6514 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6516 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6518 * data.c (PUT_ERROR): New macro.
6519 (syms_of_data): Use it. Add new error type `user-error'.
6520 * undo.c (user_error): New function.
6521 (Fprimitive_undo): Use it.
6522 * print.c (print_error_message): Adjust print style for `user-error'.
6523 * keyboard.c (user_error): New function.
6524 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6526 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6528 Do not limit current-time-string to years 1000..9999.
6529 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6530 (Fcurrent_time_string): Support any year that is supported by the
6531 underlying localtime representation. Don't use asctime, as it
6532 has undefined behavior for years outside the range -999..9999.
6534 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6536 Fix race conditions involving setenv, gmtime, localtime, asctime.
6537 Without this fix, interrupts could mess up code that uses these
6538 nonreentrant functions, since setting TZ invalidates existing
6539 tm_zone or tzname values, and since most of these functions return
6540 pointers to static storage.
6541 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6542 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6543 Grow the critical sections to include not just invoking
6544 localtime/gmtime, but also accessing these functions' results
6545 including their tm_zone values if any, and any related TZ setting.
6546 (format_time_string): Last arg is now struct tm *, not struct tm **,
6547 so that the struct tm is saved in the critical section.
6548 All callers changed. Simplify allocation of initial buffer, partly
6549 motivated by the fact that memory allocation needs to be outside
6550 the critical section.
6552 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6554 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6555 with RESET_INTERVAL.
6557 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6558 Remove duplicated buffer name initialization.
6560 2012-05-02 Jim Meyering <jim@meyering.net>
6562 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6564 * xfns.c (x_window): Use xstrdup (Bug#11375).
6566 2012-05-02 Eli Zaretskii <eliz@gnu.org>
6568 * xdisp.c (pos_visible_p): If already at a newline from the
6569 display string before the 'while' loop, don't walk back the glyphs
6570 from it3.glyph_row. Solves assertion violation when the display
6571 string begins with a newline (egg.el). (Bug#11367)
6573 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6575 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6578 2012-05-01 Glenn Morris <rgm@gnu.org>
6580 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6581 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6582 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6583 All were removed before 23.1.
6585 * dispnew.c: Remove HAVE_LIBNCURSES test;
6586 it is always true on relevant platforms.
6588 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6589 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6591 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6593 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6595 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6596 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6599 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6601 Do not avoid creating empty evaporating overlays (Bug#9642).
6602 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6603 That is, do not delete an evaporating overlay if it becomes
6604 empty after its bounds are adjusted to fit within its buffer.
6605 This fix caused other problems, and I'm reverting it until we get
6606 to the bottom of them.
6608 2012-04-27 Chong Yidong <cyd@gnu.org>
6610 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6612 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6614 * xdisp.c (pos_visible_p): If the window start position is beyond
6615 ZV, start the display from buffer beginning. Prevents assertion
6616 violation in init_iterator when the minibuffer window is scrolled
6619 * window.c (window_scroll_pixel_based): Likewise.
6621 2012-04-27 Chong Yidong <cyd@gnu.org>
6623 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6625 2012-04-27 Glenn Morris <rgm@gnu.org>
6627 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6628 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6630 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6632 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6633 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
6635 2012-04-26 Eli Zaretskii <eliz@gnu.org>
6637 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6638 display element, check also the underlying string or buffer
6639 character. (Bug#11341)
6641 * w32menu.c: Include w32heap.h.
6642 (add_menu_item): If the call to AppendMenuW (via
6643 unicode_append_menu) fails, disable Unicode menus only if we are
6644 running on Windows 9X/Me.
6646 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6648 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6649 (xgetint): Add missing shift for LSB tags.
6651 2012-04-24 Martin Rudalics <rudalics@gmx.at>
6653 * keyboard.c (read_char): Don't wipe echo area for select window
6654 events: These might get delayed via `mouse-autoselect-window'
6657 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
6659 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6660 manipulation of :loaded-from data.
6662 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
6664 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6665 now a cons (bug#11311).
6667 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6669 Do not create empty overlays with the evaporate property (Bug#9642).
6670 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6671 if it becomes empty after its bounds are adjusted to fit within
6672 its buffer. Without this fix, in a nonempty buffer (let ((o
6673 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6674 yields an empty overlay that has the evaporate property, which is
6675 not supposed to happen.
6677 Fix minor GTK3 problems found by static checking.
6678 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6679 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6680 (struct _EmacsFixedClass, emacs_fixed_get_type):
6681 Move decls here from emacsgtkfixed.h, since they needn't be public.
6682 (emacs_fixed_get_type): Now static.
6683 (emacs_fixed_class_init): Omit unused local.
6684 (emacs_fixed_child_type): Remove; unused.
6685 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6686 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6687 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6688 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6689 (EMACS_FIXED_GET_CLASS): Remove; unused.
6690 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6692 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6693 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6695 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6697 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
6698 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
6699 (__malloc_size_t, __malloc_ptrdiff_t):
6700 Remove. All uses removed, replaced by the definiens if needed,
6701 since we can assume C89 or better now.
6702 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6703 (protect_malloc_state, align, get_contiguous_space)
6704 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6705 (malloc_atfork_handler_child, malloc_enable_thread)
6706 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6707 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6708 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6709 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6710 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6711 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6712 Define using prototypes, not old style.
6713 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6714 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6715 (align): Don't assume that signed integer overflow wraps around.
6716 Omit unused local var.
6717 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6718 (_free_internal_nolock, memalign, mallochook, reallochook):
6719 Omit no-longer-needed casts.
6720 (valloc): Use getpagesize, not __getpagesize.
6721 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6722 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6724 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6726 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
6728 Move functions from C to Lisp. Make non-blocking method calls
6729 the default. Implement further D-Bus standard interfaces.
6731 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6732 (QCdbus_request_name_allow_replacement)
6733 (QCdbus_request_name_replace_existing)
6734 (QCdbus_request_name_do_not_queue)
6735 (QCdbus_request_name_reply_primary_owner)
6736 (QCdbus_request_name_reply_in_queue)
6737 (QCdbus_request_name_reply_exists)
6738 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6739 (QCdbus_registered_serial, QCdbus_registered_method)
6740 (QCdbus_registered_signal): New Lisp objects.
6741 (XD_DEBUG_MESSAGE): Use sizeof.
6742 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6743 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6744 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6745 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6746 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6747 (xd_signature, xd_append_arg): Allow float for integer types.
6748 (xd_get_connection_references): New function.
6749 (xd_get_connection_address): Rename from xd_initialize.
6750 Return cached address.
6751 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6752 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6754 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
6755 Return number of refcounts.
6756 (Fdbus_get_unique_name): Make stronger parameter check.
6757 (Fdbus_message_internal): New defun.
6758 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6759 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6760 (Fdbus_send_signal, Fdbus_register_service)
6761 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6762 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6763 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6764 (Vdbus_compiled_version, Vdbus_runtime_version)
6765 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6766 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6767 (Vdbus_message_type_signal): New defvars.
6768 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6771 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6773 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6774 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6775 Do not assume ptrdiff_t is the same width as 'int'.
6777 * alloc.c: Handle unusual debugging option combinations.
6778 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6779 since the two debugging options are incompatible.
6780 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6782 (mem_init, mem_insert, mem_insert_fixup):
6783 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6784 (NEED_MEM_INSERT): Remove; no longer needed.
6786 2012-04-22 Leo Liu <sdl.web@gmail.com>
6788 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6790 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6792 * sysdep.c [__FreeBSD__]: Minor cleanups.
6793 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6794 Use Emacs indenting style more consistently. Avoid some casts.
6795 Use 'double' consistently rather than mixing 'float' and 'double'.
6797 2012-04-21 Eduard Wiebe <usenet@pusto.de>
6799 * sysdep.c (list_system_processes, system_process_attributes):
6800 Add implementation for FreeBSD (Bug#5243).
6802 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6804 * lisp.mk (lisp): Update.
6806 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6808 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6809 It is never used otherwise.
6811 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6813 * print.c (print_preprocess): Only check print_depth if print-circle
6815 (print_object): Check for cycles even when print-circle is nil and
6816 print-gensym is t, but only check print_depth if print-circle is nil.
6818 2012-04-20 Chong Yidong <cyd@gnu.org>
6820 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6821 set the status to "failed" and ensure that sentinel is run.
6823 2012-04-20 Glenn Morris <rgm@gnu.org>
6825 * process.c (Fset_process_inherit_coding_system_flag)
6826 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
6827 (Fmake_network_process, Fmake_serial_process): Doc fix.
6829 2012-04-20 Eli Zaretskii <eliz@gnu.org>
6831 * xdisp.c (string_buffer_position_lim): Limit starting position to
6833 (set_cursor_from_row): If called for a mode-line or header-line
6834 row, return zero immediately.
6835 (try_cursor_movement): If inside continuation line, don't back up
6836 farther than the first row after the header line, if any.
6837 Don't consider the header-line row as "partially visible", even if
6838 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6840 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6842 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6845 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6846 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
6848 configure: new option --enable-gcc-warnings (Bug#11207)
6849 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6850 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6851 (ALL_CFLAGS): Use new macros rather than old.
6852 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6853 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6854 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6855 -Wunused-result, -Wunused-variable. This should go away once
6856 the Emacs and Gnulib regex code is merged.
6857 (xmalloc, xrealloc): Now static.
6859 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6861 * dired.c (Fsystem_groups): Remove unused local.
6863 2012-04-17 Glenn Morris <rgm@gnu.org>
6865 * dired.c (Fsystem_users): Doc fix.
6867 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6869 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6870 (syms_of_dired): Add them.
6872 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6874 Fix minor alloc.c problems found by static checking.
6875 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6876 New extern decls, to avoid calling undeclared functions.
6877 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6878 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6879 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6880 (NEED_MEM_INSERT): New macro.
6881 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
6882 Remove one incorrect comment and fix another.
6884 Fix minor ralloc.c problems found by static checking.
6885 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6886 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6887 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6888 (r_alloc_sbrk): Now static.
6890 Improve ralloc.c interface checking.
6891 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6892 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6893 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6894 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6895 [REL_ALLOC]: ... to here, to check interface.
6896 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6897 Remove decls. This fixes an "It stinks!".
6899 * alloc.c (which_symbols): Fix alignment issue / type clash.
6901 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6903 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6904 (struct Lisp_Misc_Any): Likewise.
6905 (struct Lisp_Free): Likewise.
6906 * alloc.c (union aligned_Lisp_Symbol): Define.
6907 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6908 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6909 (union aligned_Lisp_Misc): Define.
6910 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6911 aligned_Lisp_Misc instead of union Lisp_Misc.
6912 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
6914 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6916 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6917 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6918 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6919 * s/netbsd.h, s/sol2-6.h:
6920 Remove definition of GC_MARK_STACK, since the default now works.
6921 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6922 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6923 no longer the default.
6924 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6926 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6928 * lread.c (lisp_file_lexically_bound_p):
6929 Fix hang at ";-*-\n" (bug#11238).
6931 2012-04-14 Eli Zaretskii <eliz@gnu.org>
6933 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6934 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6936 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6938 * nsterm.m (constrainFrameRect): Always constrain when there is only
6939 one screen (Bug#10962).
6941 2012-04-13 Ken Brown <kbrown@cornell.edu>
6943 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6945 2012-04-13 Reuben Thomas <rrt@sc3d.org>
6947 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6949 2012-04-11 Daniel Colascione <dancol@dancol.org>
6951 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6952 against is gone. It's better to use vfork now so that when Cygwin
6953 gains a new, working vfork, we use it automatically (bug#10398).
6955 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6957 * window.c (save_window_save): Obey window-point-insertion-type.
6959 2012-04-11 Glenn Morris <rgm@gnu.org>
6961 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6963 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6965 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6967 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6969 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6970 (force_quit_count): New var.
6971 (handle_interrupt): Use it.
6973 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
6975 * w32.c (w32_delayed_load): Record the full path of the library
6976 being loaded (bug#10424).
6978 2012-04-09 Glenn Morris <rgm@gnu.org>
6980 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6981 not just in the obarray, before snarfing them. (Bug#11036)
6983 * Makefile.in ($(leimdir)/leim-list.el):
6984 Pass EMACS rather than BUILT_EMACS.
6986 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6988 * process.c (make_process):
6989 * process.h: Add integer `gnutls_handshakes_tried' member to
6992 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6993 Add convenience `GNUTLS_LOG2i' macro.
6995 * gnutls.c (gnutls_log_function2i): Convenience log function.
6996 (emacs_gnutls_read): Use new log functions,
6997 `gnutls_handshakes_tried' process member, and
6998 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6999 attempts per process (connection).
7001 2012-04-09 Chong Yidong <cyd@gnu.org>
7003 * eval.c (Fuser_variable_p, user_variable_p_eh)
7004 (lisp_indirect_variable): Functions deleted.
7005 (Fdefvar): Caller changed.
7007 * callint.c (Finteractive, Fcall_interactively):
7008 * minibuf.c (Fread_variable): Callers changed.
7010 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7012 * xdisp.c (set_cursor_from_row): If the display string appears in
7013 the buffer at position that is closer to point than the position
7014 after the display string, display the cursor on the first glyph of
7015 the display string. Fixes cursor display when a 'display' text
7016 property immediately follows invisible text. (Bug#11094)
7018 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7020 composite.c: use 'double' consistently
7021 * composite.c (get_composition_id): Use 'double' consistently
7022 instead of converting 'float' to 'double' and vice versa; this is
7023 easier to understand and avoids a GCC warning.
7025 2012-04-09 Glenn Morris <rgm@gnu.org>
7027 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7028 preparation for dumping it with emacs. (Bug#4789)
7029 (leimdir): New variable.
7030 ($(leimdir)/leim-list.el): New rule.
7031 (emacs$(EXEEXT)): Depend on leim-list.el.
7033 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7034 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7035 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7037 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7039 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7042 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7044 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7045 Remove unused local variable.
7047 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7049 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7050 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7051 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7052 objects, as mark_maybe_pointer will catch them otherwise.
7053 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7054 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7056 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7058 Fix typo that broke non-Windows builds.
7059 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7061 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7063 Support building on MS-Windows with libxml2.
7065 * makefile.w32-in (OBJ2): Add xml.$(O).
7066 (GLOBAL_SOURCES): Add xml.c.
7067 ($(BLD)/xml.$(O)): New dependency list.
7069 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7070 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7071 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7072 [!WINDOWSNT]: New macros.
7073 (init_libxml2_functions, libxml2_loaded_p): New functions.
7074 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7075 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7076 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7077 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7079 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7080 Call init_libxml2_functions before calling libxml2 functions.
7081 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7083 * emacs.c: Don't include libxml/parser.h.
7084 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7085 xmlCleanupParser directly.
7087 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7089 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7091 * indent.c (Fvertical_motion): If there is a display string at
7092 point, use it.vpos to compute how many lines to backtrack after
7093 move_it_to point. (Bug#11133)
7095 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7097 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7098 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7099 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7100 macros related to unification of CJK characters. For the details,
7101 see the discussion following the message here:
7102 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7104 2012-04-04 Chong Yidong <cyd@gnu.org>
7106 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7108 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7110 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7111 instead of alloca. (Bug#11138)
7113 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7115 * w32menu.c (is_simple_dialog): Properly check lisp types.
7118 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7120 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7121 position we get to after a call to move_it_to fails the
7122 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7123 only if we wind up in a string from display property. (Bug#11063)
7125 * window.c (Fdelete_other_windows_internal): Invalidate the row
7126 and column information about mouse highlight, so that redisplay
7127 restores it after reallocating the glyph matrices. (Bug#7464)
7129 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7130 string comes from a `display' text property, use the buffer
7131 position of that property as if we actually saw that position in
7133 (move_it_by_lines): Remove the assertion that
7134 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7135 violated when there's a before-string at the beginning of a line.
7138 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7140 * xdisp.c (append_space_for_newline): If the default face was
7141 remapped, use the remapped face for the appended newline.
7142 (extend_face_to_end_of_line): Use the remapped default face for
7143 extending the face to the end of the line.
7144 (display_line): Call extend_face_to_end_of_line when the default
7145 face was remapped. (Bug#11068)
7147 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7149 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7151 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7153 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7155 2012-03-27 Glenn Morris <rgm@gnu.org>
7157 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7160 2012-03-26 Kenichi Handa <handa@m17n.org>
7162 * dispextern.h (struct glyph): Fix previous change. Change the
7163 bit length of glyphless.ch to 25 (Bug#11082).
7165 2012-03-26 Chong Yidong <cyd@gnu.org>
7167 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7168 (command_loop_1): Use it; inhibit selection update for
7169 handle-select-window too (Bug#8996).
7171 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7173 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7175 2012-03-25 Kenichi Handa <handa@m17n.org>
7177 * dispextern.h (struct glyph): Change the bit length of
7178 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7180 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7182 * s/ms-w32.h (tzname): Include time.h before redirecting to
7183 _tzname. Fixes the MSVC build. (Bug#9960)
7185 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7187 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7190 * xterm.c (XTread_socket): Only modify handling_signal if
7191 !SYNC_INPUT. (Bug#11080)
7193 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7195 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7196 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7197 when fetching a multibyte character consumes more bytes than
7198 CHAR_BYTES returns, due to unification of CJK characters in
7199 string_char. (Bug#11073)
7201 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7203 * process.c (wait_reading_process_output): Handle pty disconnect
7204 by refraining from sending oneself a SIGCHLD (bug#10933).
7206 2012-03-22 Chong Yidong <cyd@gnu.org>
7208 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7210 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7211 Mark string as coming from a prefix property.
7212 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7213 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7215 2012-03-21 Chong Yidong <cyd@gnu.org>
7217 * xfaces.c (Vface_remapping_alist): Doc fix.
7219 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7221 * w32proc.c (Fw32_set_console_codepage)
7222 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7225 2012-03-20 Chong Yidong <cyd@gnu.org>
7227 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7228 to reflect default non-nil value of redisplay-dont-pause.
7230 2012-03-19 Kenichi Handa <handa@m17n.org>
7232 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7233 it fit in a valid range (Bug#11003).
7235 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7237 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7238 that is not from display property, accept the row as a "cursor
7239 row" if one of the string's character has a non-nil `cursor'
7240 property. Fixes cursor positioning when there are newlines in
7241 overlay strings, e.g. in icomplete.el. (Bug#11035)
7243 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7245 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7247 2012-03-12 Chong Yidong <cyd@gnu.org>
7249 * eval.c (inhibit_lisp_code): Rename from
7250 inhibit_window_configuration_change_hook; move from window.c.
7252 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7253 * window.c (run_window_configuration_change_hook)
7254 (syms_of_window): Callers changed.
7256 2012-03-11 Chong Yidong <cyd@gnu.org>
7258 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7260 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7262 2012-03-10 Chong Yidong <cyd@gnu.org>
7264 * frame.c (other_visible_frames): Don't assume the selected frame
7265 is visible (Bug#10955).
7267 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7269 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7271 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7273 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7274 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7277 2012-03-03 Glenn Morris <rgm@gnu.org>
7279 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7281 2012-03-02 Eli Zaretskii <eliz@gnu.org>
7283 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7284 position past the first glyph_row that ends at ZV. (Bug#10902)
7285 (redisplay_window, next_element_from_string): Fix typos in
7287 (redisplay_window): Pass to move_it_vertically the margin in
7288 pixels, not in screen lines.
7290 2012-03-02 Glenn Morris <rgm@gnu.org>
7292 * buffer.c (buffer-list-update-hook): Doc fix.
7294 2012-02-29 Eli Zaretskii <eliz@gnu.org>
7296 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7297 push_it before setting up the iterator for the first overlay
7298 string, even if we have an empty string loaded.
7299 (next_overlay_string): If there's an empty string on the iterator
7300 stack, pop the stack. (Bug#10903)
7302 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7304 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7305 Suggested by Stefan Monnier in
7306 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7307 * alloc.c (widen_to_Lisp_Object): New static function.
7308 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7309 and widening them to Lisp_Objects. This would work even if
7310 USE_LSB_TAG is defined and wide integers are used, which might
7311 happen in a future version of Emacs.
7313 2012-02-25 Chong Yidong <cyd@gnu.org>
7315 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7318 * xselect.c (Fx_selection_exists_p): Doc fix.
7319 (x_clipboard_manager_save_all): Print an informative message
7320 before saving to clipboard manager.
7322 2012-02-24 Chong Yidong <cyd@gnu.org>
7324 * keyboard.c (process_special_events): Handle all X selection
7325 requests in kbd_buffer, not just the next one (Bug#8869).
7327 2012-02-23 Chong Yidong <cyd@gnu.org>
7329 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7330 call when setting menu-bar-lines and tool-bar-lines parameters.
7331 (unwind_create_frame_1): New helper function.
7333 * window.c (inhibit_window_configuration_change_hook): New var.
7334 (run_window_configuration_change_hook): Obey it.
7335 (syms_of_window): Initialize it.
7337 2012-02-22 Chong Yidong <cyd@gnu.org>
7339 * xterm.c (x_draw_image_relief): Add missing type check for
7340 Vtool_bar_button_margin (Bug#10743).
7342 2012-02-21 Chong Yidong <cyd@gnu.org>
7344 * fileio.c (Vfile_name_handler_alist): Doc fix.
7346 * buffer.c (Fget_file_buffer): Protect against invalid file
7347 handler return value.
7349 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7351 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7352 when computing $valmask.
7354 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7355 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7356 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7357 It's useless in that case, and it can cause problems on hosts
7358 that allocate halves of EMACS_INT values separately.
7359 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7360 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7361 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7362 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7363 it avoids undefined behavior on hosts where shifting right by more
7364 than the word width has undefined behavior.
7366 2012-02-19 Chong Yidong <cyd@gnu.org>
7368 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7369 (Funhandled_file_name_directory, Ffile_name_as_directory)
7370 (Fdirectory_file_name, Fexpand_file_name)
7371 (Fsubstitute_in_file_name): Protect against invalid file handler
7372 return values (Bug#10845).
7374 2012-02-18 Eli Zaretskii <eliz@gnu.org>
7376 * .gdbinit (pitx): Fix incorrect references to fields of the
7379 2012-02-17 Chong Yidong <cyd@gnu.org>
7381 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7383 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7385 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7386 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7388 2012-02-15 Chong Yidong <cyd@gnu.org>
7390 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7391 marked as special. Also, starting docstrings with * is obsolete.
7393 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7395 * gnutls.c (emacs_gnutls_write): Fix last change.
7397 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7399 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7402 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7404 * keymap.c (Fsingle_key_description): Handle char ranges.
7406 2012-02-12 Chong Yidong <cyd@gnu.org>
7408 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7409 as that creates a dangerous corner case.
7411 * window.c (Fdelete_window_internal): Invalidate the mouse
7412 highlight (Bug#9904).
7414 2012-02-12 Glenn Morris <rgm@gnu.org>
7416 * xselect.c (Fx_own_selection_internal)
7417 (Fx_get_selection_internal, Fx_disown_selection_internal)
7418 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7419 * nsselect.m (Fx_own_selection_internal)
7420 (Fx_disown_selection_internal, Fx_selection_exists_p)
7421 (Fx_selection_owner_p, Fx_get_selection_internal):
7422 Sync docs and argument specs with the xselect.c versions.
7424 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7426 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7428 2012-02-11 Eli Zaretskii <eliz@gnu.org>
7430 * w32select.c (Fx_selection_exists_p): Sync doc string and
7431 argument list with xselect.c. (Bug#10783)
7433 * w16select.c (Fx_selection_exists_p): Sync doc string and
7434 argument list with xselect.c. (Bug#10783)
7436 2012-02-10 Glenn Morris <rgm@gnu.org>
7438 * fns.c (Fsecure_hash): Doc fix.
7440 2012-02-09 Kenichi Handa <handa@m17n.org>
7442 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7444 2012-02-07 Chong Yidong <cyd@gnu.org>
7446 * buffer.c (Fbuffer_local_variables)
7447 (buffer_lisp_local_variables): Handle unbound vars correctly;
7448 don't let Qunbound leak into Lisp.
7450 2012-02-07 Glenn Morris <rgm@gnu.org>
7452 * image.c (Fimagemagick_types): Doc fix.
7454 * image.c (imagemagick-render-type): Change it from a lisp object
7455 to an integer. Move the doc here from the lisp manual.
7456 Treat all values not equal to 0 the same.
7458 2012-02-06 Chong Yidong <cyd@gnu.org>
7460 * doc.c (store_function_docstring): Avoid applying docstring of
7461 alias to base function (Bug#2603).
7463 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7465 * .gdbinit (pp1, pv1): Remove redundant defines.
7468 2012-02-04 Chong Yidong <cyd@gnu.org>
7470 * nsterm.m: Declare a global (Bug#10694).
7472 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7474 * w32.c (get_emacs_configuration_options):
7475 Include --enable-checking, if specified, in the return value.
7477 2012-02-04 Martin Rudalics <rudalics@gmx.at>
7479 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7480 after rounding frame sizes. (Bug#9723)
7482 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7484 * keyboard.c (adjust_point_for_property): Don't position point
7485 before BEGV. (Bug#10696)
7487 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7489 Handle overflow when computing char display width (Bug#9496).
7490 * character.c (char_width): Return EMACS_INT, not int.
7491 (char_width, c_string_width): Check for overflow when
7492 computing the width; this is possible now that individual
7493 characters can have unbounded width. Problem introduced
7494 by merge from Emacs 23 on 2012-01-19.
7496 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
7498 * dbusbind.c (Fdbus_register_method): Mention the return value
7499 :ignore in the docstring.
7501 2012-02-02 Glenn Morris <rgm@gnu.org>
7503 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7505 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7506 Unconditionally set to t. (Bug#10673)
7507 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7508 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7509 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7511 2012-02-02 Kenichi Handa <handa@m17n.org>
7513 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7514 0, do not call append_composite_glyph.
7516 2012-02-02 Kenichi Handa <handa@m17n.org>
7518 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7520 (x_produce_glyphs): If the component of a composition is a null
7521 string, set it->pixel_width to 1 to avoid zero-width glyph.
7523 2012-02-01 Eli Zaretskii <eliz@gnu.org>
7525 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7526 first 2 arguments are identical. This makes inserting large
7527 output from a subprocess an order of magnitude faster on
7528 MS-Windows, where all sbrk'ed memory is always contiguous.
7530 2012-01-31 Glenn Morris <rgm@gnu.org>
7532 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7533 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7534 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7536 2012-01-29 Glenn Morris <rgm@gnu.org>
7538 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7540 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7542 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7544 2012-01-28 Chong Yidong <cyd@gnu.org>
7546 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7548 2012-01-26 Chong Yidong <cyd@gnu.org>
7550 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7552 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7553 repeat counts (Bug#10507).
7555 2012-01-26 Glenn Morris <rgm@gnu.org>
7557 * lread.c (syms_of_lread): Doc fix.
7559 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7561 * coding.c (encode_designation_at_bol): Change return value to
7564 2012-01-25 Chong Yidong <cyd@gnu.org>
7566 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7568 2012-01-21 Chong Yidong <cyd@gnu.org>
7570 * floatfns.c (Fcopysign): Make the second argument non-optional,
7571 since nil is not allowed anyway.
7573 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7575 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7576 (send_process): Likewise.
7578 2012-01-19 Martin Rudalics <rudalics@gmx.at>
7580 * window.c (save_window_save, Fcurrent_window_configuration)
7581 (Vwindow_persistent_parameters): Do not use Qstate.
7582 Rewrite doc-strings.
7584 2012-01-19 Kenichi Handa <handa@m17n.org>
7586 * character.c (char_width): New function.
7587 (Fchar_width, c_string_width, lisp_string_width):
7588 Use char_width (Bug#9496).
7590 2012-01-16 Martin Rudalics <rudalics@gmx.at>
7592 * window.c (Vwindow_persistent_parameters): New variable.
7593 (Fset_window_configuration, save_window_save): Handle persistent
7596 2012-01-14 Eli Zaretskii <eliz@gnu.org>
7598 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7599 thrashing the stack of the thread. (Bug#9087)
7601 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7603 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7605 2012-01-11 Eli Zaretskii <eliz@gnu.org>
7607 * xdisp.c (rows_from_pos_range): Handle the case where the
7608 highlight ends on a newline. (Bug#10464)
7609 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7610 he end column for display of highlight that ends on a newline
7613 2012-01-11 Glenn Morris <rgm@gnu.org>
7615 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7616 from load-path also when installation-directory is nil. (Bug#10208)
7618 2012-01-10 Glenn Morris <rgm@gnu.org>
7620 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7622 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7623 Update template values to be closer to their typical values these days.
7625 2012-01-09 Eli Zaretskii <eliz@gnu.org>
7627 * xdisp.c (rows_from_pos_range): Accept additional argument
7628 DISP_STRING, and accept any glyph in a row whose object is that
7629 string as eligible for mouse highlight. Fixes mouse highlight of
7630 display strings from overlays. (Bug#10464)
7632 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
7634 emacs: fix an auto-save permissions race condition (Bug#10400)
7635 * fileio.c (auto_saving_dir_umask): New static var.
7636 (Fmake_directory_internal): Use it.
7637 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7638 creating the directory. The old code temporarily assigns
7639 too-generous permissions to the directory.
7640 (do_auto_save_eh): Clear it.
7641 (Fdo_auto_save): Catch all errors, not just file errors, so
7642 that the var is always cleared.
7644 2012-01-07 Eli Zaretskii <eliz@gnu.org>
7646 * search.c (scan_buffer): Pass character positions to
7647 know_region_cache, not byte positions. (Bug#6540)
7649 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
7651 * w32.c (sys_rename): Report EXDEV when rename of a directory
7652 fails because the target is on another logical disk. (Bug#10284)
7654 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7656 * xterm.c (x_embed_request_focus): New function.
7658 * xterm.h: Add prototype.
7660 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7662 2012-01-05 Glenn Morris <rgm@gnu.org>
7664 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7666 2012-01-01 Eli Zaretskii <eliz@gnu.org>
7668 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7669 Load gnutls_transport_set_lowat only if GnuTLS version is below
7671 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7672 GnuTLS versions below 2.11.1.
7674 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7676 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7677 to the doc string advising against its use for altering the way
7678 windows are scrolled.
7680 2011-12-28 Kenichi Handa <handa@m17n.org>
7682 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7683 coding-system ASCII compatible only when it does not produce BOM
7684 on encoding (Bug#10383).
7686 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7688 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7690 (create_and_show_popup_menu): Always use menu_position_func for
7693 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7695 * callint.c (Fcall_interactively): Don't truncate prompt string.
7697 2011-12-23 Eli Zaretskii <eliz@gnu.org>
7699 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7700 property that ends at ZV, so that the bidi iteration could be
7701 resumed from there (after widening). (Bug#10360)
7703 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7705 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7707 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7709 * nsterm.m (x_free_frame_resources):
7710 Release f->output_data.ns->miniimage.
7711 (ns_index_color): Fix indentation. Do not retain
7712 color_table->colors[i].
7714 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7717 * nsfns.m (x_set_background_color): Assign return value from
7718 ns_index_color to face-background instead of NSColor*.
7719 (ns_implicitly_set_icon_type): Fix indentation.
7720 Change assignment in for loop to comparison.
7722 * emacs.c (ns_pool): New variable.
7723 (main): Assign ns_pool.
7724 (Fkill_emacs): Call ns_release_autorelease_pool.
7726 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7727 autorelease fdesc, release fdAttrs and tdict.
7728 (ns_get_covering_families): Release charset.
7729 (ns_findfonts): Release NSFontDescriptor created with new.
7730 (ns_uni_to_glyphs): Fix indentation.
7731 (setString): Release attrStr before assigning new value.
7733 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7735 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7737 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7738 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7740 2011-12-18 David Reitter <reitter@cmu.edu>
7742 * nsterm.m (ns_term_init): Subscribe for notifications
7743 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7744 to method trackingNotification in EmacsMenu.
7746 * nsmenu.m (trackingMenu): New variable.
7747 (trackingNotification): New method (from Aquamacs).
7748 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
7749 from Aquamacs (Bug#7030).
7751 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7753 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7754 (symbol_to_nsstring): Fix indentation.
7755 (ns_symbol_to_pb): New function.
7756 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7757 (Fns_rotate_cut_buffers_internal): Remove.
7758 (Fns_store_selection_internal): Rename from
7759 Fns_store_cut_buffer_internal.
7760 (ns_get_foreign_selection, Fx_own_selection_internal)
7761 (Fx_disown_selection_internal, Fx_selection_exists_p)
7762 (Fns_get_selection_internal, Fns_store_selection_internal):
7763 Use ns_symbol_to_pb and check if return value is nil.
7764 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7765 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
7766 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7767 renamed to Sns_store_selection_internal.
7768 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7769 and remove this function.
7770 (ns_handle_selection_clear): Remove, never used.
7771 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7774 2011-12-17 Ken Brown <kbrown@cornell.edu>
7776 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7777 GID is unknown (Bug#10257).
7779 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7781 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7782 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7783 which caused a build failure on GNU/Linux IA-64. This problem was
7784 introduced by my 2011-10-07 patch.
7786 2011-12-15 Juri Linkov <juri@jurta.org>
7788 * image.c (imagemagick_error): New function. (Bug#10112)
7789 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7790 Use `imagemagick_error' where ImageMagick functions return
7792 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7795 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7797 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7798 fill background (Bug#8992).
7800 2011-12-13 Martin Rudalics <rudalics@gmx.at>
7802 * window.c (Vwindow_combination_resize)
7803 (Vwindow_combination_limit): Use t instead of non-nil in
7805 (Vrecenter_redisplay): Add first sentence of doc-string on
7807 (Frecenter): Fix doc-string typo.
7809 2011-12-11 Kenichi Handa <handa@m17n.org>
7811 * coding.c (Funencodable_char_position): Pay attention to the
7812 buffer text relocation (Bug#9389).
7814 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7816 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7817 gtk_init (Bug#10100).
7819 2011-12-10 Eli Zaretskii <eliz@gnu.org>
7821 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7822 IT->string is nil. (Bug#10263)
7824 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7826 * nsterm.h (x_free_frame_resources): Declare.
7828 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7829 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7831 * nsterm.h (ns_get_defaults_value): Declare.
7833 * nsterm.m (ns_default): Call ns_get_defaults_value.
7835 2011-12-09 Eli Zaretskii <eliz@gnu.org>
7837 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7840 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7842 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7843 that where the value of an _OBJC_* symbol points to is in the .bss
7844 section (Bug#10240).
7846 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7848 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
7849 after the loop to call ccl_driver at least once (Bug#8619).
7851 2011-12-08 Kenichi Handa <handa@m17n.org>
7853 * ftfont.c (get_adstyle_property): Fix previous change
7856 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
7858 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7859 dirs from the default value of EMACSLOADPATH (bug#10208).
7861 2011-12-07 Glenn Morris <rgm@gnu.org>
7863 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7864 installation and source directories as well. (Bug#10208)
7866 2011-12-06 Chong Yidong <cyd@gnu.org>
7868 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7870 2011-12-06 Glenn Morris <rgm@gnu.org>
7872 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7873 as an error, not just -1. (Bug#10217)
7875 2011-12-05 Chong Yidong <cyd@gnu.org>
7877 * keyboard.c (process_special_events): New function.
7878 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7880 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7882 * coding.c (encode_designation_at_bol): Don't use uninitialized
7883 local variable (Bug#9318).
7885 2011-12-05 Kenichi Handa <handa@m17n.org>
7887 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7888 return Qnil (Bug#8046, Bug#10193).
7890 2011-12-05 Kenichi Handa <handa@m17n.org>
7892 * coding.c (encode_designation_at_bol): New args charbuf_end and
7893 dst. Return the number of produced bytes. Callers changed.
7894 (coding_set_source): Return how many bytes coding->source was
7896 (coding_set_destination): Return how many bytes
7897 coding->destination was relocated.
7898 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
7899 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
7901 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7903 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7904 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7907 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7909 The following changes are to fix Bug#9318.
7911 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
7912 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7913 (encode_coding_iso_2022, encode_coding_sjis)
7914 (encode_coding_big5, encode_coding_charset): Use the above macros.
7916 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
7918 * lisp.h (process_quit_flag): Fix external declaration.
7920 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7922 Don't macro-inline non-performance-critical code.
7923 * eval.c (process_quit_flag): New function.
7924 * lisp.h (QUIT): Use it.
7926 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7928 * nsfns.m (get_geometry_from_preferences): New function.
7929 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7931 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7933 * emacs.c (Qkill_emacs): Define.
7934 (syms_of_emacs): Initialize it.
7935 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7936 Qquit_flag to `kill-emacs' instead.
7937 (quit_throw_to_read_char): Add parameter `from_signal'.
7938 All callers changed. Call Fkill_emacs if requested and safe.
7939 * lisp.h (QUIT): Call Fkill_emacs if requested.
7941 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7943 * widget.c (update_wm_hints): Return if wmshell is null.
7944 (widget_update_wm_size_hints): New function.
7946 * widget.h (widget_update_wm_size_hints): Declare.
7948 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7949 widget_update_wm_size_hints (Bug#10104).
7951 2011-12-03 Eli Zaretskii <eliz@gnu.org>
7953 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7954 before a newline, prepare the bidi iterator for consuming the
7955 newline, and keep the current paragraph direction. (Bug#10183)
7956 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
7958 2011-12-02 Juri Linkov <juri@jurta.org>
7960 * search.c (Fword_search_regexp): New Lisp function created from
7961 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7962 (Fword_search_backward, Fword_search_forward)
7963 (Fword_search_backward_lax, Fword_search_forward_lax):
7964 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7965 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7967 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7969 * fileio.c (Finsert_file_contents): Move after-change-function call
7970 to before the "handled:" label, since all "goto handled" appear in
7971 cases where the *-change-functions have already been properly called
7974 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7976 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7977 waiting for input. (Bug#10169)
7979 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7981 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7982 verifies glyph row's hash code--we have just reallocated the
7983 glyphs, so their contents can be complete garbage. (Bug#10164)
7985 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
7987 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7989 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7991 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7992 attributes are tested _before_ calling verify_row_hash, to protect
7993 against GCC re-ordering of the tests. (Bug#10164)
7995 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7997 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7999 * xterm.c (handle_one_xevent): Only set async_visible and friends
8000 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8001 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8002 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8004 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8006 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8007 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8008 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8009 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8010 All uses changed to use GCPRO1 etc.
8011 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8012 Revert to old implementation (i.e., before 2011-03-11).
8014 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8016 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8017 of scroll runs so as to avoid assigning disabled bogus rows and
8018 unnecessary graphics copy operations.
8020 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8022 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8023 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8024 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8025 (malloc, free, realloc, calloc): Redirect to e_* only when
8028 * lisp.h (GCTYPEBITS): Move before first use.
8029 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8030 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8031 this macro definition.
8033 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8036 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8038 * gtkutil.c (xg_create_frame_widgets):
8039 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8040 present with Gtk+ 2.0.
8042 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8044 * fileio.c (Finsert_file_contents): Undo previous change; see
8045 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8047 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8049 Rename locals to avoid shadowing.
8050 * fileio.c (Finsert_file_contents):
8051 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8052 * process.c (wait_reading_process_output):
8053 Rename inner 'proc' to 'p' to avoid shadowing.
8054 Indent for consistency with usual Emacs style.
8056 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8058 * xdisp.c (redisplay_window): If cursor row is not fully visible
8059 after recentering, and scroll-conservatively is set to a large
8060 number, scroll window by a few more lines to make the cursor fully
8061 visible and out of scroll-margin. (Bug#10105)
8062 (start_display): Don't move to the next line if the display should
8063 start at a newline that is part of a display vector or an overlay
8066 2011-11-24 Juri Linkov <juri@jurta.org>
8068 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8069 after the `MagickPingImage' call. (Bug#10112)
8071 2011-11-23 Chong Yidong <cyd@gnu.org>
8073 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8075 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8077 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8078 making another buffer current. (Bug#10114)
8080 2011-11-23 Glenn Morris <rgm@gnu.org>
8082 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8084 2011-11-23 Chong Yidong <cyd@gnu.org>
8086 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8087 using it (Bug#5984).
8089 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8091 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8092 and header-lines, as they don't have one computed for them.
8095 * .gdbinit (prow): Make displayed values more self-explaining.
8096 Add row's hash code.
8098 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8100 * process.c (wait_reading_process_output): Fix asynchrounous
8101 GnuTLS socket handling on some versions of the GnuTLS library.
8102 (wait_reading_process_output): Add comment and URL.
8104 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8106 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8108 2011-11-21 Chong Yidong <cyd@gnu.org>
8110 * window.c (Fnext_window, Fprevious_window): Doc fix.
8112 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8114 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8116 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8118 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8120 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8122 * window.c (Fset_window_combination_limit): Rename argument
8124 (Vwindow_combination_limit): Remove "status" from doc-string.
8126 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8128 * m/ibms390.h: Remove.
8129 * m/ibms390x.h: Don't include "ibms390.h".
8131 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8133 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8134 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8136 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8138 * casetab.c (Fset_case_table):
8139 * charset.c (Fcharset_after): Fix typos.
8141 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8143 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8144 Otherwise, valgrind does not work on some platforms.
8145 Problem reported by Andreas Schwab in
8146 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8147 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8148 is set, removing the need for VIRT_ADDRESS_VARIES.
8149 (PURE_P): Use a more-efficient implementation that needs just one
8150 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8151 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8152 to 4 (xorl, subq, cmpq, setbe).
8153 * alloc.c (pure): Always extern now, since that's the
8154 VIRT_ADDR_VARIES behavior.
8155 (PURE_POINTER_P): Use a single comparison, not two, for
8156 consistency with the new puresize.h.
8157 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8158 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8159 Remove VIRT_ADDR_VARIES no longer needed.
8161 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8163 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8164 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8165 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8166 behave as if the cursor position were at the window margin.
8168 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8169 and the cursor position is out of bounds, behave as if the cursor
8170 position were at the window margin. (Bug#10075)
8172 2011-11-18 Chong Yidong <cyd@gnu.org>
8174 * window.c (Fwindow_combination_limit): Make first argument
8175 non-optional, since it is meaningless for live windows like the
8178 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8180 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8182 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8184 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8185 (graft_intervals_into_buffer): Simplify.
8187 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8189 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8190 hash values of the two rows.
8191 (copy_row_except_pointers): Preserve the used[] arrays and the
8192 hash values of the two rows. (Bug#10035)
8193 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8195 * xdisp.c (row_hash): New function, body extracted from
8196 compute_line_metrics.
8197 (compute_line_metrics): Call row_hash, instead of computing the
8200 * dispnew.c (verify_row_hash): Call row_hash for computing the
8201 hash code of a row, instead of duplicating code from xdisp.c.
8203 * dispextern.h (row_hash): Add prototype.
8205 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8207 * frame.c (delete_frame): Don't delete the terminal when the last
8208 X frame is closed if emacs is built with GTK toolkit.
8210 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8212 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8214 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8216 * window.c (Vwindow_splits): Rename to
8217 Vwindow_combination_resize. Suggested by Juri Linkov.
8218 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8221 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8223 * nsfns.m (Fns_font_name):
8224 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8226 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8228 * window.h (window): Rename slot "nest" to "combination_limit".
8229 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8230 (Fset_window_nest): Rename to Fset_window_combination_limit.
8231 (Vwindow_nest): Rename to Vwindow_combination_limit.
8232 (recombine_windows, make_parent_window, make_window)
8233 (Fsplit_window_internal, saved_window)
8234 (Fset_window_configuration, save_window_save): Rename all
8235 occurrences of window_nest to window_combination_limit.
8237 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8239 * image.c (imagemagick_load_image): Fix typo.
8241 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8243 * xdisp.c (display_line): Move the call to
8244 highlight_trailing_whitespace before the call to
8245 compute_line_metrics, since the latter needs to see the final
8246 faces of all the glyphs to compute ROW's hash value.
8247 Fixes assertion violations in row_equal_p. (Bug#10035)
8249 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8251 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8252 just return (bug#10044).
8254 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8256 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8257 with user-defined heap size. Bump the default size of the temacs
8258 heap to 27MB, to avoid memory warning when running temacs.
8259 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8261 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8262 current_matrix and desired_matrix. (Bug#9990)
8263 (verify_row_hash) [XASSERTS]: New function.
8264 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8265 that the hash value of glyph rows is correct.
8267 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8269 * window.h (window): Remove splits slot.
8270 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8271 (Fdelete_other_windows_internal, make_parent_window)
8272 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8273 (Fset_window_configuration, save_window_save): Don't deal with
8274 split status of windows.
8275 (saved_window): Remove splits slot.
8276 (Vwindow_splits): Rewrite doc-string.
8278 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8280 * xfns.c (unwind_create_frame):
8281 * nsfns.m (unwind_create_frame):
8282 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8283 Vframe_list (Bug#9999).
8285 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8287 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8289 2011-11-11 Kenichi Handa <handa@m17n.org>
8291 * callproc.c (Fcall_process): Set the member dst_multibyte of
8294 2011-11-11 Johan Bockgård <bojohan@gnu.org>
8296 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8297 avoid a crash (bug#9496).
8299 2011-11-09 Chong Yidong <cyd@gnu.org>
8301 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8302 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8304 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8306 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8308 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8310 Avoid some portability problems by eschewing 'extern inline' functions.
8311 The trivial performance wins aren't worth the portability hassles; see
8312 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8314 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8315 (window_box_width, window_box_left, window_box_left_offset)
8316 (window_box_right, window_box_right_offset): Undo previous change,
8317 by removing the "extern"s.
8318 * intervals.c (adjust_intervals_for_insertion)
8319 (adjust_intervals_for_deletion): Undo previous change,
8320 making these static again.
8321 (offset_intervals, temp_set_point_both, temp_set_point)
8322 (copy_intervals_to_string): No longer inline.
8323 * xdisp.c (window_text_bottom_y, window_box_width)
8324 (window_box_height, window_box_left_offset)
8325 (window_box_right_offset, window_box_left, window_box_right)
8326 (window_box): No longer inline.
8328 2011-11-08 Chong Yidong <cyd@gnu.org>
8330 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
8331 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8332 Signal an error if not a live window.
8333 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8334 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8336 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
8338 * lisp.h (syms_of_abbrev): Remove declaration.
8339 Reported by CHENG Gao <chenggao@royau.me>.
8341 2011-11-07 Eli Zaretskii <eliz@gnu.org>
8343 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8344 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8345 of temacs in GUI mode.
8347 2011-11-07 Martin Rudalics <rudalics@gmx.at>
8349 * window.h: Declare delete_all_child_windows instead of
8350 delete_all_subwindows.
8351 * window.c (Fwindow_nest, Fset_window_nest)
8352 (Fset_window_new_total, Fset_window_new_normal)
8353 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8354 (delete_all_subwindows): Rename to delete_all_child_windows.
8355 (Fdelete_other_windows_internal, Fset_window_configuration):
8356 Call delete_all_child_windows instead of delete_all_subwindows.
8357 * frame.c (delete_frame): Call delete_all_child_windows instead
8358 of delete_all_subwindows.
8360 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8362 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8363 This is also needed for porting to any host where GC_MARK_STACK is
8364 not GC_MAKE_GCPROS_NOOPS.
8365 (which_symbols): Use it.
8367 2011-11-07 Kenichi Handa <handa@m17n.org>
8369 * coding.c (coding_set_destination): Check coding->src_pos only
8370 when coding->src_object is a buffer (bug#9910).
8372 * process.c (send_process): Set the member src_multibyte of coding
8373 to 0 (bug#9911) when sending a unibyte text.
8375 * callproc.c (Fcall_process): Set the member src_multibyte of
8376 process_coding to 0 (bug#9912).
8378 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8380 * xmenu.c (cleanup_widget_value_tree): New function.
8381 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8382 calling free_menubar_widget_value_tree directly (Bug#9830).
8384 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8386 Fix some portability problems with 'inline'.
8387 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8388 (window_box_width, window_box_left, window_box_left_offset)
8389 (window_box_right, window_box_right_offset): Declare extern.
8390 Otherwise, these inline functions do not conform to C99 and
8391 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8392 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8393 * intervals.c (adjust_intervals_for_insertion)
8394 (adjust_intervals_for_deletion): Now extern, because otherwise the
8395 extern inline functions 'offset_intervals' couldn't refer to it.
8396 (static_offset_intervals): Remove.
8397 (offset_intervals): Rewrite using the old contents of
8398 static_offset_intervals. The old version didn't conform to C99
8399 because an extern inline function contained a reference to an
8400 identifier with static linkage.
8402 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8404 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8407 2011-11-06 Eli Zaretskii <eliz@gnu.org>
8409 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8410 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8411 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8412 return Qleft_to_right.
8414 2011-11-06 Chong Yidong <cyd@gnu.org>
8416 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8417 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8418 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8419 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8420 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8421 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8422 (Fwindow_vscroll): Doc fix.
8423 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8424 argument, since it makes no sense to pass a live window and for
8425 consistency with window-child.
8427 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8429 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8432 2011-11-05 Jason Rumney <jasonr@gnu.org>
8434 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8435 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8437 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8438 bitwise arithmetic preventing use of unicode-sip and non-truetype
8441 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8443 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8446 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8447 initialization code to keep similarity to xfns.c after changes
8450 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8452 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8453 (unwind_create_frame): New function (Bug#9943).
8454 (Fx_create_frame): Restructure code to be more similar to the one in
8455 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8456 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8457 Move terminal->reference_count++ just before making the frame official
8460 * nsterm.m (x_free_frame_resources): New function.
8461 (x_destroy_window): Move code to x_free_frame_resources.
8463 * xfns.c (unwind_create_frame): Fix comment.
8464 (Fx_create_frame, x_create_tip_frame):
8465 Move terminal->reference_count++ just before making the frame
8466 official. Move initialization of image_cache_refcount and
8467 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8469 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8471 Support MSVC build with newer versions of Visual Studio.
8472 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8473 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8476 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8477 which are not supported by MSVC.
8478 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8479 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8481 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8483 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8485 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8487 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
8489 Support MSVC build with newer versions of Visual Studio.
8490 * w32.c: Don't include w32api.h for MSVC.
8491 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8493 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8494 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8495 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8496 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8498 (alloca) [_MSC_VER]: Define to _alloca.
8500 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8502 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8504 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8506 * xdisp.c (note_mouse_highlight): If either of
8507 previous/next-single-property-change returns nil, treat that as
8508 the beginning or the end of the buffer. (Bug#9955)
8510 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8512 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
8513 label is not null (Bug#9951).
8514 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8517 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8519 * window.c (Fwindow_body_size): Mention in the doc string that the
8520 return value is in frame's canonical units. (Bug#9949)
8522 2011-11-03 Eli Zaretskii <eliz@gnu.org>
8524 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8526 * w32fns.c (unwind_create_frame): If needed, free the glyph
8527 matrices of the partially constructed frame. (Bug#9943)
8528 * xfns.c (unwind_create_frame): Likewise.
8530 2011-11-01 Eli Zaretskii <eliz@gnu.org>
8532 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8533 Don't stop backward scan on the continuation glyph, even though
8534 its CHARPOS is positive.
8535 (mouse_face_from_buffer_pos, note_mouse_highlight):
8536 Rename cover_string to disp_string.
8538 2011-11-01 Martin Rudalics <rudalics@gmx.at>
8540 * window.c (temp_output_buffer_show): Don't use
8541 Vtemp_buffer_show_specifiers.
8542 (Vtemp_buffer_show_specifiers): Remove unused variable.
8544 2011-10-30 Eli Zaretskii <eliz@gnu.org>
8546 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8547 past the beginning of the current glyph matrix.
8549 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
8551 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8552 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8553 HAVE_GTK3 (Bug#9869).
8555 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8556 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8558 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8560 * xterm.c: Declare x_handle_net_wm_state to return int.
8561 (handle_one_xevent): Check if we are iconified but don't have
8562 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8563 (get_current_wm_state): Return non-zero if not hidden,
8564 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8565 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8566 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8567 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8569 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8571 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8572 so that this new function doesn't get optimized away by a
8573 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8575 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8577 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8579 2011-10-29 Eli Zaretskii <eliz@gnu.org>
8581 Fix the `xbytecode' command.
8582 * .gdbinit (xprintbytestr): New command.
8583 (xwhichsymbols): Rename from `which'; all callers changed.
8584 (xbytecode): Print the byte-code string as well.
8586 2011-10-29 Kim Storm <storm@cua.dk>
8588 * alloc.c (which_symbols): New function.
8590 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8592 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8595 2011-10-29 Glenn Morris <rgm@gnu.org>
8597 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8598 Not clear what it was for, and it causes various bugs. (Bug#9839)
8600 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8602 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8603 possible random value that matches one of those tested as
8604 condition to clear the mouse face.
8606 2011-10-28 Chong Yidong <cyd@gnu.org>
8608 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8610 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8612 * window.c (make_window): Initialize phys_cursor_on_p.
8614 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8616 * lisp.h (struct Lisp_Symbol): Update comments.
8618 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
8620 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8622 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8624 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8625 <oslsachem@gmail.com> for helping to debug this.
8627 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8628 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8629 (g_b_init_get_glyph_outline_w): New static variables.
8630 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8631 (GetGlyphOutlineW_Proc): New typedefs.
8632 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
8633 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8635 (w32font_open_internal, compute_metrics):
8636 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
8637 instead of calling the "wide" APIs directly.
8639 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8641 * w32.h (syms_of_w32font): Add prototype.
8643 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8645 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8646 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8647 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8648 (Fmove_to_window_line): Doc fix.
8650 2011-10-27 Chong Yidong <cyd@gnu.org>
8652 * process.c (make_process): Set gnutls_state to NULL.
8654 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8655 non-NULL, regardless of GNUTLS_INITSTAGE.
8656 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8657 an error. Set process slots as soon as we allocate them.
8659 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8661 2011-10-27 Chong Yidong <cyd@gnu.org>
8663 * gnutls.c (emacs_gnutls_deinit): New function.
8664 Deallocate credentials structures as well as calling gnutls_deinit.
8665 (Fgnutls_deinit, Fgnutls_boot): Use it.
8667 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8668 (deactivate_process): Call emacs_gnutls_deinit.
8670 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8672 * image.c (x_create_x_image_and_pixmap):
8673 * w32.c (sys_rename, w32_delayed_load):
8674 * w32font.c (fill_in_logfont):
8675 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8677 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
8679 * w32fns.c (w32_default_color_map): New function,
8680 extracted from Fw32_default_color_map.
8681 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
8683 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8685 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8687 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8689 * keyboard.c (test_undefined): New function (bug#9751).
8690 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8692 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8694 * sysdep.c (init_sys_modes): Fix the check for the controlling
8695 terminal (Bug#6649).
8697 2011-10-20 Eli Zaretskii <eliz@gnu.org>
8699 * dispextern.h (struct bidi_it): New member next_en_type.
8701 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8702 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8703 current character, check also for next_en_type being WEAK_EN.
8704 (bidi_resolve_weak): Don't enter the expensive loop if the current
8705 position is before next_en_pos. Record the bidi type of the first
8706 non-ET, non-BN character we find, in addition to its position.
8707 (bidi_level_of_next_char): Invalidate next_en_type when
8708 next_en_pos is over-stepped.
8710 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8712 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8713 * editfns.c: Rewrite current-time-zone so that it invokes
8714 the equivalent of (format-time-string "%Z") to get the time zone name.
8715 This fixes a bug when the time zone name contains characters that
8716 need converting from the system time locale to Emacs internal format.
8717 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8718 that patch fixed format-time-string to do the conversion, but
8719 I forgot to fix current-time-zone.
8720 (format_time_string): New function, containing most of
8721 what Fformat_time_string used to contain.
8722 (Fformat_time_string): Rewrite in terms of format_time_string.
8723 This doesn't change this function's behavior.
8724 (current-time-zone): Rewrite to use format_time_string.
8725 This fixes the bug reported by Michael Schierl in
8726 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8727 Jason Rumney's 2007-06-07 change worked around this bug, but
8729 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8731 2011-10-19 Eli Zaretskii <eliz@gnu.org>
8733 * xdisp.c (start_display): If the character at POS is displayed
8734 via a display vector, reset IT->current.dpvec_index to zero.
8735 (try_window_reusing_current_matrix): If a line ends in a display
8736 vector or the next line starts in a display vector, continue
8737 redrawing the window even though the character position of
8738 start_row was reached.
8741 2011-10-18 Chong Yidong <cyd@gnu.org>
8743 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8744 with nobreak-char-display too.
8746 2011-10-18 Eli Zaretskii <eliz@gnu.org>
8748 Fix part 3 of bug#9771.
8749 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8750 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8751 non-neutral characters if the current character is a paragraph
8752 separator (a.k.a. Newline). This avoids running the same
8753 expensive loop twice, once when we consume the preceding newline
8754 and the other time when the line actually needs to be displayed.
8755 Avoid the loop when we see neutrals on the base embedding level
8756 following a character whose directionality is the same as the
8757 paragraph's. This avoids running the expensive loop when a line
8758 ends in a long sequence of neutrals, like control characters.
8759 Add assertion against STRONG_AL type. Slightly rearrange code
8760 that determines the type of a neutral given the first non-neutral
8762 (bidi_level_of_next_char): Set next_en_pos to zero when
8763 invalidating its info.
8765 2011-10-17 Eli Zaretskii <eliz@gnu.org>
8767 * xdisp.c (push_display_prop): Determine whether to record string
8768 or buffer position by IT->string, not by IT->method. Allow
8769 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
8770 (move_it_vertically_backward): Don't look for character position
8771 immediately after the newline when in a continuation line.
8774 2011-10-15 Martin Rudalics <rudalics@gmx.at>
8776 * window.c (coordinates_in_window): Rewrite and delabelize
8777 vertical border check. (Bug#5357) (Bug#9618)
8779 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8781 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8782 errors in XSetWindowBorder (bug#9310).
8784 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8786 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8787 avoid crash when xmalloc overrun checking is enabled.
8789 2011-10-13 Eli Zaretskii <eliz@gnu.org>
8791 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8792 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8793 cursor motion with <left> and <right> arrow keys.
8795 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8796 some callers set that themselves.
8798 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8800 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8801 display string and the previous row comes from the same string and
8802 is empty. (Bug#9739) (Bug#9738)
8804 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8806 * doc.c (get_doc_string): Encode file name (bug#9735).
8808 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8810 * bidi.c (bidi_level_of_next_char):
8811 * xdisp.c (get_visually_first_element): Remove old incorrect
8812 comments regarding the Unicode Line Separator character.
8814 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8816 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8818 * alloc.c (Fgc_status): Do not access beyond zombies array
8819 boundary if nzombies > MAX_ZOMBIES.
8820 * alloc.c (dump_zombies): Add missing format specifier.
8822 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8824 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8825 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8827 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8828 Some packages use them to denote characters with modifiers.
8830 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8832 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8833 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8834 matching a pp-number. Rename parameter var to var1.
8836 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8838 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8840 2011-10-08 Glenn Morris <rgm@gnu.org>
8842 * callint.c (Fcall_interactively): Give a more explicit error for the
8843 'c' case with a non-character input. (Bug#8479)
8845 2011-10-08 Eli Zaretskii <eliz@gnu.org>
8847 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8849 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8850 lines that are hscrolled on the left.
8852 * dispnew.c (buffer_posn_from_coords): Account for a possible
8853 presence of header-line. (Bug#4426)
8855 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8857 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8858 Don't advertise functionality which we discourage or doesn't work.
8860 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8862 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8863 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8864 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8865 this makes Emacs dump core during garbage collection on rare
8866 occasions. sizeof is obviously inferior to offsetof here, so
8867 stick with offsetof.
8868 (GC_POINTER_ALIGNMENT): New macro.
8869 (mark_memory): Omit 3rd (offset) arg; caller changed.
8870 Don't assume EMACS_INT alignment is the same as pointer alignment.
8872 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8874 * keyboard.c (read_key_sequence_remapped): New var.
8875 (read_key_sequence): Compute remapping in the right buffer.
8876 (command_loop_1): Use read_key_sequence's remapping directly.
8878 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8880 * dired.c (file_name_completion): Don't expand file name.
8881 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8882 before checking file name handler.
8884 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8885 they've been requested explicitly (bug#9591).
8887 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
8889 * keymap.c (Fsingle_key_description): Use make_specified_string
8890 instead of build_string to build string from push_key_description.
8893 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8895 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8896 This fixes a Y2038 bug on 64-bit hosts.
8897 * buffer.c (reset_buffer):
8898 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8899 (Fclear_buffer_auto_save_failure):
8900 Use 0, not -1, to represent an unset failure time, since time_t
8901 might not be signed.
8903 Remove dependency on glibc malloc internals.
8904 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8905 Move back here from lisp.h, but with their new implementations.
8906 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8907 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8908 * charset.c (charset_table_init): New static var.
8909 (syms_of_charset): Use it instead of xmalloc. This removes a
8910 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8911 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8912 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8913 Move back to alloc.c.
8914 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8915 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8917 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8919 * nsterm.m (windowDidResize): Call x_set_window_size only when
8920 ns_in_resize is true. Otherwise set pixelwidth/height and
8921 call change_frame_size (Bug#9628).
8923 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8925 Port --enable-checking=all to Fedora 14 x86-64.
8926 * charset.c (syms_of_charset): Also account for glibc malloc's
8927 internal overhead when calculating the initial malloc maximum.
8929 Port --enable-checking=all to Fedora 14 x86.
8930 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8932 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8933 (overrun_check_realloc, overrun_check_free):
8934 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8935 That way, xmalloc returns a properly-aligned pointer even if
8936 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8937 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8938 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8939 into account when calculating the initial malloc maximum.
8940 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8941 Move here from alloc.c, so that charset.c can use it too.
8942 Properly align; the old code wasn't right for common 32-bit hosts
8943 when configured with --enable-checking=all.
8944 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8945 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8947 2011-09-29 Eli Zaretskii <eliz@gnu.org>
8949 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
8952 2011-09-28 Eli Zaretskii <eliz@gnu.org>
8954 * xdisp.c (compute_display_string_end): If there's no display
8955 string at CHARPOS, return -1.
8957 * bidi.c (bidi_fetch_char): When compute_display_string_end
8958 returns a negative value, treat the character as a normal
8959 character not covered by a display string. (Bug#9624)
8961 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
8963 * lread.c (Fread_from_string): Fix typo in docstring.
8965 2011-09-27 Eli Zaretskii <eliz@gnu.org>
8967 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8968 newline, reseat the iterator instead of bidi-iterating there one
8969 character at a time. (Bug#9610)
8970 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8971 TO_CHARPOS if the bidi iterator is at base embedding level.
8973 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8975 * lread.c (readevalloop): Use correct code for NBSP.
8976 (read1): Likewise. (Bug#9608)
8978 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
8980 * dbusbind.c (Fdbus_register_signal): When service is not
8981 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8983 2011-09-25 Glenn Morris <rgm@gnu.org>
8985 * buffer.c (truncate-lines): Doc fix.
8987 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
8989 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8990 (Fset_window_next_buffers): Doc fix.
8992 2011-09-24 Glenn Morris <rgm@gnu.org>
8994 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8996 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8998 Fix minor problems found by static checking.
8999 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9000 * indent.c (Fvertical_motion): Fix == vs = typo.
9002 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9004 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9005 Default value is now t. Doc fix.
9007 * indent.c (Fvertical_motion): Compute and apply the overshoot
9008 logic when moving up, not only when moving down. Fix the
9009 confusing name and values of the it_overshoot_expected variable;
9010 logic changes accordingly. (Bug#9254) (Bug#9549)
9012 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9013 CHARPOS is covered by a display string which includes newlines.
9014 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9015 is covered by a display string with embedded newlines.
9017 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9019 * dbusbind.c (Fdbus_register_signal): Add match rule to
9020 Vdbus_registered_objects_table. (Bug#9581)
9021 (Fdbus_register_method, Vdbus_registered_objects_table):
9024 2011-09-24 Jim Meyering <meyering@redhat.com>
9026 do not ignore write error for any output size
9027 The previous change was incomplete.
9028 While it makes emacs --batch detect the vast majority of stdout
9029 write failures, errors were still ignored whenever the output size is
9030 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9031 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9032 && echo FAIL: ignored write error
9033 FAIL: ignored write error
9034 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9035 && echo FAIL: ignored write error
9036 FAIL: ignored write error
9037 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9039 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9041 * emacs.c (Fkill_emacs): In noninteractive mode exit
9042 non-successfully if a write error occurred on stdout. (Bug#9574)
9044 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9046 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9049 * dispextern.h (struct it): Update the comment documenting what
9052 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9054 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9055 a display string, extend search for cursor position to end of row.
9056 (find_row_edges): If the row ends in a newline from a display
9057 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9058 Handle the case of a display string with multiple newlines.
9059 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9060 non-empty line. Fixes confusing cursor motion with arrow keys at
9061 the beginning of a line that starts with whitespace.
9063 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9065 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9068 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9070 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9073 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9075 * xdisp.c (display_line): Record maximum and minimum buffer
9076 positions even if no glyphs were produced (e.g., by a zero-width
9077 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9078 buffer positions that will be removed from the glyph row because
9080 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9081 column is beyond frame width: don't subtract 1 "pixel" when
9082 computing width of the stretch.
9083 (reseat_at_next_visible_line_start): Undo the change made on
9084 2011-09-17 that saved paragraph information and restored it after
9085 the call to `reseat'. (Bug#9545)
9087 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9089 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9090 and turn window cursor on if cleared (Bug#9415).
9092 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9094 * search.c (boyer_moore): Take unibyte characters from pattern
9095 literally. (Bug#9458)
9097 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9099 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9101 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9103 Fix minor problem found by static checking.
9104 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9105 initialized, to pacify gcc -Wuninitialized.
9107 * fileio.c: Report proper errno when syscall falls.
9108 (Finsert_file_contents): Save and restore errno,
9109 so that report_file_error outputs the correct diagnostic.
9110 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9112 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9114 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9116 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9118 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9119 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9121 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9123 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9124 about the current paragraph and restore it after the call to reseat.
9126 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9127 (bidi_find_paragraph_start): Search back for paragraph beginning
9128 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9129 (bidi_move_to_visually_next): Only trigger paragraph-related
9130 computations when the last character is a newline or at EOB, not
9131 just any NEUTRAL_B. (Bug#9470)
9133 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9134 truncated lines if point is covered by a display string. (Bug#9524)
9136 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9138 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9139 (cons_to_x_long): New function.
9140 (lisp_data_to_selection_data): Use it. Correct the test for
9141 short-versus-long data; it was negated. Break out of vector
9142 loop, for efficiency, when a long datum is discovered.
9144 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9146 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9148 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9150 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9151 GCC PR/17406) by declaring this function with external scope.
9153 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9155 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9156 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9158 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9160 * editfns.c (Fformat): Correctly handle text properties on "%%".
9162 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9164 * xterm.c (x_draw_composite_glyph_string_foreground):
9165 * w32term.c (x_draw_composite_glyph_string_foreground):
9166 * term.c (encode_terminal_code):
9167 * composite.c (composition_update_it, get_composition_id):
9168 * xdisp.c (get_next_display_element)
9169 (fill_composite_glyph_string): Add comments about special meaning
9170 of TAB characters in a composition.
9172 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9174 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9175 This occurs when processing a multibyte format.
9176 Problem reported by Wolfgang Jenker.
9178 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9180 * xdisp.c (try_cursor_movement): Only check for exact match if
9181 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9183 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9185 Remove unused external symbols.
9186 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9187 * xdisp.c (calc_pixel_width_or_height): Now static.
9188 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9189 * indent.c (check_display_width):
9190 * w32term.c: Fix comment to match code.
9191 * xterm.c, xterm.h (x_catching_errors): Remove.
9193 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9195 * xselect.c: Use signed conversions more consistently (Bug#9498).
9196 (selection_data_to_lisp_data): Assume incoming selection data are
9197 signed integers, not unsigned. This is to be consistent with
9198 outgoing selection data, which was modified to use signed integers
9199 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9200 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9201 expects long, not unsigned long.
9203 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9205 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9206 computation of loop end. Reported by Johan Bockgård
9209 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9211 * frame.c (Fother_visible_frames_p): Function deleted.
9213 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9215 * indent.c (compute_motion): Process display vector front to back
9216 rather than the other way around. (Bug#2496)
9218 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9220 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9222 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9224 * minibuf.c (Fread_from_minibuffer): Doc fix.
9226 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9228 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9229 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9231 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9233 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9234 value for non-existent files.
9236 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9238 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9239 set its "size" to -1. This will set the modtime_size field of
9240 the corresponding buffer to -1, which is what
9241 verify-visited-file-modtime expects for files that do not exist.
9244 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9246 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9248 * lisp.h: ... from here. push_key_description is no longer
9249 defined in keyboard.c, so its declaration should not be in
9250 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9251 logically belongs with push_key_description.
9253 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9255 * buffer.h: Include <sys/types.h> instead of <time.h>.
9256 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9257 Problem reported by Herbert J. Skuhra.
9259 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9261 * xml.c (parse_region): Make the parsing work for
9262 non-comment-starting XML files again (bug#9144).
9264 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9266 * image.c (gif_load): Fix calculation of bottom and right corner.
9269 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9271 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9272 redisplay in small windows.
9274 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9276 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9278 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9280 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9281 Operate on live windows only.
9283 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
9285 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9287 2011-09-07 Eli Zaretskii <eliz@gnu.org>
9289 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9290 only under bidi iteration.
9292 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9294 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9296 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9298 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9299 Without this fix, the command to link temacs failed due to an
9300 undefined symbol __builtin_isnan. This is because
9301 /usr/include/iso/math_c99.h #defines isnan(x) to
9302 __builtin_isnan(x), but the bundled gcc, which identifies itself
9303 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9305 * floatfns.c (isnan): #undef, and then #define to a clone of
9307 (Fisnan): Always define, since it's always available now.
9308 (syms_of_floatfns): Always define isnan at the Lisp level.
9310 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9312 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9314 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9316 * fileio.c: Fix bugs with large file offsets (Bug#9428).
9317 The previous code assumed that file offsets (off_t values) fit in
9318 EMACS_INT variables, which is not true on typical 32-bit hosts.
9319 The code messed up by falsely reporting buffer overflow in cases
9320 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9321 when "big" contains more than 2**29 bytes, even though this
9322 inserts just one byte and does not overflow the buffer.
9323 (Finsert_file_contents): Store file offsets as off_t
9324 values, not as EMACS_INT values. Check for overflow when
9325 converting between EMACS_INT and off_t. When checking for
9326 buffer overflow or for overlap, take the offsets into account.
9327 Don't use EMACS_INT for small values where int suffices.
9328 When checking for overlap, fix a typo: ZV was used where
9329 ZV_BYTE was intended.
9330 (Fwrite_region): Don't assume off_t fits into 'long'.
9331 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9333 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
9335 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9337 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9339 sprintf-related integer and memory overflow issues (Bug#9412).
9341 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
9342 (esprintf, exprintf, evxprintf): New functions.
9343 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
9344 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
9345 (modify_event_symbol): Do not assume that the length of
9346 name_alist_or_stem is safe to alloca and fits in int.
9347 (Fexecute_extended_command): Likewise for function name and binding.
9348 (Frecursion_depth): Wrap around reliably on integer overflow.
9349 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9350 since some callers pass EMACS_INT values.
9351 (Fsingle_key_description): Don't crash if symbol name contains more
9352 than MAX_ALLOCA bytes.
9353 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9354 (get_minibuffer): Arg is now EMACS_INT, not int.
9355 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
9356 (esprintf, exprintf, evxprintf): New decls.
9357 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9359 * dbusbind.c (signature_cat): New function.
9360 (xd_signature, Fdbus_register_signal):
9361 Do not overrun buffer; instead, report string overflow.
9363 * dispnew.c (add_window_display_history): Don't overrun buffer.
9364 Truncate instead; this is OK since it's just a log.
9366 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9367 even if the time zone offset is outlandishly large.
9368 Don't mishandle offset == INT_MIN.
9370 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9371 when creating daemon; the previous buffer-overflow check was incorrect.
9373 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9374 which has the guts of the old verror function.
9376 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9377 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9379 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9380 (font_unparse_xlfd): Don't blindly alloca long strings.
9381 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9382 fits in int, when using sprintf. Use single snprintf to count
9383 length of string rather than counting it via multiple sprintfs;
9384 that's simpler and more reliable.
9385 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9386 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9387 sprintf, in case result does not fit in int.
9389 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9390 (fontset_from_font): Print it.
9392 * frame.c (tty_frame_count): Now printmax_t, not int.
9393 (make_terminal_frame, set_term_frame_name): Print it.
9394 (x_report_frame_params): In X, window IDs are unsigned long,
9395 not signed long, so print them as unsigned.
9396 (validate_x_resource_name): Check for implausibly long names,
9397 and don't assume name length fits in 'int'.
9398 (x_get_resource_string): Don't blindly alloca invocation name;
9399 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9402 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9403 (xg_check_special_colors, xg_set_geometry):
9404 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9406 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9407 Use esprintf, not sprintf, in case result does not fit in int.
9409 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9410 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9411 it as a large positive number.
9412 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9413 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9415 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9416 in case result does not fit in int.
9418 * print.c (float_to_string): Detect width overflow more reliably.
9419 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9420 buffer overrun. Don't assume list length fits in 'int'. Treat
9421 print length of 0 as 0, not as infinity; to be consistent with other
9422 uses of print length in this function. Don't overflow print length
9423 index. Don't assume hash table size fits in 'long', or that
9424 vectorlike size fits in 'unsigned long'.
9426 * process.c (make_process): Use printmax_t, not int, to format
9427 process-name gensyms.
9429 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9431 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9432 to avoid potential buffer overrun.
9434 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9435 if X resource line is longer than 512 bytes.
9437 * xfns.c (x_window): Make sprintf buffer a bit bigger
9438 to avoid potential buffer overrun.
9440 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9442 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9444 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9446 Integer overflow fixes for scrolling, etc.
9447 Without these, Emacs silently mishandles large integers sometimes.
9448 For example, "C-u 4294967297 M-x recenter" was treated as if
9449 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9451 * xdisp.c (try_window_id): Check Emacs fixnum range before
9452 converting to 'int'.
9454 * window.c (window_scroll_line_based, Frecenter):
9455 Check that an Emacs fixnum is in range before assigning it to 'int'.
9456 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9457 values converted from Emacs fixnums.
9458 (Frecenter): Don't wrap around a line count if it is out of 'int'
9459 range; instead, treat it as an extreme value.
9460 (Fset_window_configuration, compare_window_configurations):
9461 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9463 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9464 that can exceed INT_MAX. Check that EMACS_INT value is in range
9465 before assigning it to the (possibly-narrower) index.
9466 (match_limit): Don't assume that a fixnum can fit in 'int'.
9468 * print.c (print_object): Use ptrdiff_t, not int, for index that can
9471 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
9472 (Fvertical_motion): Don't wrap around LINES values that don't fit
9473 in 'int'. Instead, treat them as extreme values. This is good
9474 enough for windows, which can't have more than INT_MAX lines anyway.
9476 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9478 * Require libxml/parser.h to avoid compilation warning.
9480 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9482 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9483 since this reportedly can destroy thread storage.
9485 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
9487 * syntax.c (find_defun_start): Update all cache variables if
9488 exiting early (Bug#9401).
9490 2011-08-30 Eli Zaretskii <eliz@gnu.org>
9492 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9494 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9495 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9496 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9498 * term.c (tty_append_glyph): New function.
9499 (produce_stretch_glyph): Static function and its prototype deleted.
9501 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9504 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9506 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9507 when checking :margin (Bug#9390).
9508 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
9509 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
9510 so that the name doesn't mislead. All uses changed.
9512 2011-08-28 Johan Bockgård <bojohan@gnu.org>
9514 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9517 2011-08-27 Eli Zaretskii <eliz@gnu.org>
9519 * xdisp.c (move_it_to): Don't bail out early when reaching
9520 position beyond to_charpos, if we are scanning backwards.
9521 (move_it_vertically_backward): When DY == 0, make sure we get to
9522 the first character in the line after the newline.
9524 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9526 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9527 (ccl_driver): Do not generate an out-of-range pointer.
9528 (Fccl_execute_on_string): Remove unnecessary check for
9529 integer overflow, noted by Stefan Monnier in
9530 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9531 Remove a FIXME that didn't need fixing.
9532 Simplify the newly-introduced buffer reallocation code.
9534 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
9536 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9538 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
9540 Integer and memory overflow issues (Bug#9196).
9542 * doc.c (get_doc_string): Rework so that
9543 get_doc_string_buffer_size is the actual buffer size, rather than
9544 being 1 less than the actual buffer size; this makes xpalloc more
9547 * image.c (x_allocate_bitmap_record, cache_image):
9548 * xselect.c (Fx_register_dnd_atom):
9549 Simplify previous changes by using xpalloc.
9551 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9552 since either will do and ptrdiff_t is convenient with xpalloc.
9554 * charset.c (charset_table_size)
9555 (struct charset_sort_data.priority): Now ptrdiff_t.
9556 (charset_compare): Don't overflow if priorities differ greatly.
9557 (Fsort_charsets): Don't assume list length fits in int.
9558 Check for size-calculation overflow when allocating sort data.
9559 (syms_of_charset): Allocate an initial charset table that is
9560 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9562 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9564 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9565 The actual value is always <= INT_MAX, and leaving it unsigned made
9566 overflow checking harder.
9568 * dispextern.h (struct glyph_matrix.rows_allocated)
9569 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9570 with xpalloc. The values are still always <= INT_MAX.
9572 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9574 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9575 (SAFE_NALLOCA): New macro.
9577 * region-cache.c (struct boundary.pos, find_cache_boundary)
9578 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9579 (set_cache_region, invalidate_region_cache)
9580 (revalidate_region_cache, know_region_cache, region_cache_forward)
9581 (region_cache_backward, pp_cache):
9582 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9583 so that ptrdiff_t * can be passed to xpalloc.
9584 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9585 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9586 (pp_cache): Don't assume cache_len fits in int.
9587 * region-cache.h: Adjust extern decls to match.
9589 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9590 EMACS_INT, since either will do, for xpalloc.
9592 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9593 (xnmalloc, xnrealloc, xpalloc): New functions.
9595 * bidi.c (bidi_shelve_header_size): New constant.
9596 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9597 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9599 * bidi.c (bidi_cache_shrink):
9600 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9602 Don't update size of array until after memory allocation succeeds,
9603 because xmalloc/xrealloc may not return.
9604 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9605 now that we have proper integer overflow checking.
9606 (record_overlay_string, overlay_strings): Catch overflows when
9607 calculating size of overlay_str_buf.
9609 * callproc.c (Fcall_process): Check for size overflow when
9610 calculating size of args2.
9611 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9612 Normally we prefer signed values, but sticking with ptrdiff_t would
9613 require adding more-complicated checks.
9615 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9616 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9617 Redo buffer-overflow calculations to avoid integer overflow.
9618 Add a FIXME comment where memory seems to be over-allocated.
9620 * character.c (Fstring): Check for size-calculation overflow.
9622 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9623 unnecessary integer overflow. Check for size overflow.
9624 (encode_coding_object): Don't update size until xmalloc succeeds.
9626 * composite.c (get_composition_id): Check for overflow in glyph
9627 length calculations.
9629 Integer and memory overflow fixes for display code.
9630 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9631 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9632 (scrolling_window): Check for overflow in size calculations.
9633 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9634 Don't assume glyph table len fits in int.
9635 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9636 (row_table_size): Now ptrdiff_t, not int.
9637 (scrolling_window): Avoid overflow in size calculations.
9638 Don't update size until allocation succeeds.
9639 * fns.c (concat): Check for overflow in size calculations.
9640 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9641 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9642 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9644 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9645 (get_doc_string): Check for size calculation overflow.
9646 Don't update size until allocation succeeds.
9647 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9648 EMACS_INT, where ptrdiff_t will do.
9649 (Fsubstitute_command_keys): Check for string overflow.
9651 * editfns.c (set_time_zone_rule): Don't assume environment length
9653 (message_length): Now ptrdiff_t, not int.
9654 (Fmessage_box): Don't update size until allocation succeeds.
9655 Don't assume message length fits in int.
9656 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9658 * emacs.c (main): Do not reallocate argv, since there is a null at
9659 the end that can be overwritten, and this way there's no need to
9660 worry about size-calculation overflow.
9661 (sort_args): Check for size-calculation overflow.
9663 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9665 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9667 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9668 (x_set_scroll_bar_width, x_figure_window_size):
9669 Check for integer overflow.
9670 (x_set_alpha): Do not assume XINT fits in int.
9672 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9673 This is for the members text_lines, text_cols, total_lines, total_cols,
9674 where the system imposes an 'int' limit.
9676 * fringe.c (Fdefine_fringe_bitmap):
9677 Don't update size until alloc works.
9679 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9680 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9682 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9683 Check for size-calculation overflow.
9684 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9685 do, as we prefer signed integers.
9686 (id_to_widget.max_size, id_to_widget.used)
9687 (xg_store_widget_in_map, xg_remove_widget_from_map)
9688 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9689 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9690 Use and return ptrdiff_t, not int.
9691 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9692 * gtkutil.h: Change prototypes to match the above.
9694 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9695 are duplicate now that they've been promoted to lisp.h.
9696 (x_allocate_bitmap_record, x_alloc_image_color)
9697 (make_image_cache, cache_image, xpm_load):
9698 Don't update size until alloc is done.
9699 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9701 Check for size calculation overflow.
9702 (ct_colors_allocated_max): New constant.
9703 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9706 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9707 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9708 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9709 Use ptrdiff_t, not int, to count maps.
9710 (read_char_minibuf_menu_prompt): Check for overflow in size
9711 calculations. Don't update size until allocation succeeds.
9712 Redo calculations to avoid overflow.
9713 * keyboard.h: Change prototypes to match the above.
9715 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9717 (current_minor_maps): Check for size calculation overflow.
9718 * keymap.h: Change prototypes to match the above.
9720 * lread.c (read1, init_obarray): Don't update size until alloc done.
9722 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9723 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9725 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9726 Now ptrdiff_t, not int.
9727 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9728 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9730 * process.c (Fnetwork_interface_list): Check for overflow
9731 in size calculation.
9733 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9735 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9736 overflow. Don't bother calling xmalloc when xrealloc will do.
9738 * search.c (Freplace_match): Check for size calculation overflow.
9739 (Fset_match_data): Don't assume list lengths fit in 'int'.
9741 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9742 for command line length. Do not attempt to address one before the
9743 beginning of an array, as that's not portable.
9745 * term.c (max_frame_lines): Remove; unused.
9746 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9748 (encode_terminal_code, calculate_costs): Check for size
9749 calculation overflow.
9750 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9751 table lengths and related sizes. Don't update size until alloc
9752 done. Redo calculations to avoid overflow.
9753 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9755 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9756 subtracting pointers.
9757 (gobble_line): Check for overflow more carefully. Don't update size
9760 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9761 Don't update size until alloc done.
9762 Redo size calculations to avoid overflow.
9763 Check for size calculation overflow.
9764 (main) [DEBUG]: Fix typo in invoking tparam1.
9766 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9767 Use ptrdiff_t, not int, for sizes.
9768 (store_mode_line_noprop_char): Don't update size until alloc done.
9770 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9771 Use ptrdiff_t, not int, for sizes.
9772 (Finternal_make_lisp_face, cache_face):
9773 Check for size calculation overflow.
9774 (cache_face): Treat size calculation overflows as if they were
9775 memory exhaustion (the usual treatment), rather than aborting.
9777 * xfns.c (x_encode_text, x_set_name_internal)
9778 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9779 sizes, since they can exceed INT_MAX in size. Check for size
9780 calculation overflow.
9782 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9783 (xg_select): Check for size calculation overflow.
9784 Don't update size until alloc done.
9786 * xrdb.c (get_environ_db): Don't assume path length fits in int,
9787 as sprintf is limited to int lengths.
9789 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9790 (X_LONG_MIN): New macros.
9791 Use them to make the following changes clearer.
9792 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9793 This change doesn't affect the value now, but it may help remind
9794 future maintainers not to raise the value too much later.
9795 (SELECTION_QUANTUM): Remove, replacing with ...
9796 (selection_quantum): ... new function, which avoids overflow.
9798 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9799 assumption that selection length fits in 'int'.
9800 (x_reply_selection_request, x_handle_selection_request)
9801 (x_get_window_property, receive_incremental_selection)
9802 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9803 (lisp_data_to_selection_data, clean_local_selection_data):
9804 Use ptrdiff_t, not int, to record length of selection.
9805 (x_reply_selection_request, x_get_window_property)
9806 (receive_incremental_selection, x_property_data_to_lisp):
9807 Redo calculations to avoid overflow.
9808 (x_reply_selection_request): When sending hint, ceiling it at
9809 X_LONG_MAX rather than relying on wraparound overflow to send
9811 (x_get_window_property, receive_incremental_selection)
9812 (lisp_data_to_selection_data, x_property_data_to_lisp):
9813 Check for size-calculation overflow.
9814 (x_get_window_property, receive_incremental_selection)
9815 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9816 Don't store size until memory allocation succeeds.
9817 (x_get_window_property): Plug memory leak on memory exhaustion.
9818 Don't double-block input; malloc is safe here. Don't assume 2**34
9819 - 4 fits in unsigned long. Add an xassert to check
9820 XGetWindowProperty overflow. Be more careful about overflow
9821 calculations, and distinguish size from memory overflow better.
9822 (receive_incremental_selection): When tracing, don't assume
9823 unsigned int is less than INT_MAX.
9824 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9825 harmful) conversions of unsigned short to int.
9826 (lisp_data_to_selection_data): Don't assume that integers
9827 in the range -65535 through -1 fit in an X unsigned short.
9828 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9829 result parameters unless successful. Rely on cons_to_unsigned
9830 to report problems with elements; the old code wasn't right anyway.
9831 (x_check_property_data): Check for int overflow; we cannot use
9832 a wider type due to X limits.
9833 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9835 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
9837 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9838 (x_term_init): Check for size calculation overflow.
9839 (x_color_cells): Don't store size until memory allocation succeeds.
9840 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
9841 Don't assume alloca size is less than MAX_ALLOCA.
9842 (x_term_init): Don't assume length fits in int (sprintf is limited
9845 Use ptrdiff_t for composition IDs.
9846 * character.c (lisp_string_width):
9847 * composite.c (composition_table_size, n_compositions)
9848 (get_composition_id, composition_gstring_from_id):
9849 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9850 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9851 * window.c (Frecenter):
9852 Use ptrdiff_t, not int, for composition IDs.
9853 * composite.c (get_composition_id): Check for integer overflow.
9854 * composite.h: Adjust prototypes to match the above changes.
9856 Use ptrdiff_t for hash table indexes.
9857 * category.c (hash_get_category_set):
9858 * ccl.c (ccl_driver):
9859 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9860 * coding.c (coding_system_charset_list, detect_coding_system):
9861 * coding.h (struct coding_system.id):
9862 * composite.c (get_composition_id, gstring_lookup_cache):
9863 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9864 * image.c (xpm_get_color_table_h):
9865 * lisp.h (hash_lookup, hash_put):
9866 * minibuf.c (Ftest_completion):
9867 Use ptrdiff_t for hash table indexes, not int (which is too
9868 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9869 32-bit --with-wide-int hosts).
9871 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9872 Add a FIXME comment about memory leaks.
9873 (syms_of_charset): Don't assume xmalloc returns.
9875 Don't assume that stated character widths fit in int.
9876 * character.c (Fchar_width, c_string_width, lisp_string_width):
9877 * character.h (CHAR_WIDTH):
9878 * indent.c (MULTIBYTE_BYTES_WIDTH):
9879 Use sanitize_char_width to avoid undefined and/or bad behavior
9880 with outlandish widths.
9881 * character.h (sanitize_tab_width): Rename from sanitize_width,
9882 now that we have two such functions. All uses changed.
9883 (sanitize_char_width): New inline function.
9885 Don't assume that tab-width fits in int.
9886 * character.h (sanitize_width): New inline function.
9887 (SANE_TAB_WIDTH): New macro.
9888 (ASCII_CHAR_WIDTH): Use it.
9889 * indent.c (sane_tab_width): Remove. All uses replaced by
9890 SANE_TAB_WIDTH (current_buffer).
9891 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9893 * fileio.c: Integer overflow issues with file modes.
9894 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9896 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9897 Remove unreachable code.
9898 (read_hex, load_charset_map_from_file): Check for integer overflow.
9900 * xterm.c: Don't go over XClientMessageEvent limit.
9901 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9902 (x_send_scroll_bar_event): Likewise. Check that the size does not
9903 exceed limits imposed by XClientMessageEvent, as well as the usual
9904 ptrdiff_t and size_t limits.
9906 * keyboard.c: Overflow, signedness and related fixes.
9907 (make_lispy_movement): Use same integer type in forward decl
9908 that is used in the definition.
9909 (read_key_sequence, keyremap_step):
9910 Change bufsize argument back to int, undoing my 2011-03-30 change.
9911 We prefer signed types, and int is wide enough here.
9912 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9913 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9914 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9915 length, not size_t. Use ptrdiff_t for index, not int.
9916 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9917 possibility of integer overflow.
9919 Overflow, signedness and related fixes for images.
9921 * dispextern.h (struct it.stack[0].u.image.image_id)
9922 (struct_it.image_id, struct image.id, struct image_cache.size)
9923 (struct image_cache.used, struct image_cache.ref_count):
9924 * gtkutil.c (update_frame_tool_bar):
9925 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9926 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9927 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9928 * nsmenu.m (update_frame_tool_bar):
9929 * xdisp.c (calc_pixel_width_or_height):
9930 * xfns.c (image_cache_refcount):
9931 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9932 on typical 64-bit hosts.
9934 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9935 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9936 Omit unnecessary casts to int.
9937 (parse_image_spec): Check that integers fall into 'int' range
9938 when the callers expect that.
9939 (image_ascent): Redo ascent calculation to avoid int overflow.
9940 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9941 (lookup_image): Remove unnecessary tests.
9942 (xbm_image_p): Locals are now of int, not EMACS_INT,
9943 since parse_image_check makes sure they fit into int.
9944 (png_load, gif_load, svg_load_image):
9945 Prefer int to unsigned where either will do.
9946 (tiff_handler): New function, combining the cores of the
9947 old tiff_error_handler and tiff_warning_handler.
9948 This function is rewritten to use vsnprintf and thereby avoid
9949 stack buffer overflows. It uses only the features of vsnprintf
9950 that are common to both POSIX and native Microsoft.
9951 (tiff_error_handler, tiff_warning_handler): Use it.
9952 (tiff_load, gif_load, imagemagick_load_image):
9953 Don't assume :index value fits in 'int'.
9954 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9955 (imagemagick_load_image): Check that crop parameters fit into
9956 the integer types that MagickCropImage accepts. Don't assume
9957 Vimagemagick_render_type has a nonnegative value. Don't assume
9958 size_t fits in 'long'.
9959 (gs_load): Use printmax_t to print the widest integers possible.
9960 Check for integer overflow when computing image height and width.
9962 2011-08-26 Eli Zaretskii <eliz@gnu.org>
9964 * xdisp.c (redisplay_window): Don't force window start if point
9965 will be invisible in the resulting window. (Bug#9324)
9967 2011-08-25 Eli Zaretskii <eliz@gnu.org>
9969 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9970 the display spec is of the form `(space ...)'.
9971 (handle_display_spec): Return the value returned by
9972 handle_single_display_spec, not just 1 or zero.
9973 (handle_single_display_spec): If the display spec is of the form
9974 `(space ...)', and specifies display in the text area, return 2
9976 (try_cursor_movement): Check for the need to scroll more
9977 accurately, and prefer exact match for point under bidi.
9978 Don't advance `row' beyond the last row of the window.
9980 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9981 into disp_prop; all users changed.
9983 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9984 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9985 for the text covered by the display property.
9987 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
9989 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9990 Change return value to nil.
9991 (Frecord_buffer): Delete unused function.
9993 2011-08-24 Eli Zaretskii <eliz@gnu.org>
9995 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9996 buffers, return left-to-right.
9997 (set_cursor_from_row): Consider candidate row a win if its glyph
9998 represents a newline and point is on that newline. Fixes cursor
9999 positioning on the newline at EOL of R2L text within L2R
10000 paragraph, and vice versa.
10001 (try_cursor_movement): Check continued rows, in addition to
10002 continuation rows. Fixes unwarranted scroll when point enters a
10003 continued line of R2L text within an L2R paragraph, or vice versa.
10004 (cursor_row_p): Consider the case of point being equal to
10005 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10006 from the end of a short line to the beginning of a continued line
10007 of R2L text within L2R paragraph.
10008 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10009 composed characters.
10011 * bidi.c (bidi_check_type): Use xassert.
10012 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10015 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10017 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10020 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10022 * nsfont.m (ns_otf_to_script): Fix typo.
10024 2011-08-22 Kenichi Handa <handa@m17n.org>
10026 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10027 extra slot even if the purpose is char-code-property-table.
10029 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10031 * xdisp.c (redisplay_window): When computing centering_position,
10032 account for the height of the header line. (Bug#8874)
10034 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10035 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10036 candidate is selected by the mouse, and that candidate has a
10037 composed character under the mouse.
10039 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10040 coordinates reported by pos-visible-in-window-p for a composed
10041 character in column zero.
10043 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10045 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10047 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10049 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10050 consider it a hit if to_charpos is anywhere in the range of the
10051 composed buffer positions.
10053 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10055 * image.c (gif_load): Don't assume that each subimage has the same
10056 dimensions as the base image. Handle disposal method that is
10057 "undefined" by the gif spec (Bug#9335).
10059 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10061 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10062 (Fcondition_case): Document `debug' symbol in error handler.
10064 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10066 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10067 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10068 from an Org mode buffer to a Speedbar frame.
10070 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10071 a composition, take its buffer position from IT->cmp_it.charpos.
10072 Fixes cursor positioning at the beginning of a line that begins
10073 with a composed character.
10075 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10077 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10078 character bidirectional type, use STRONG_L instead. Fixes crashes
10079 in a buffer produced by `describe-categories'.
10081 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10082 members before the level stack, so they would be saved and
10083 restored when copying iterator state. Fixes incorrect reordering
10084 around TABs covered by display properties.
10086 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10088 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10090 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10092 * eval.c (internal_condition_case, internal_condition_case_1)
10093 (internal_condition_case_2, internal_condition_case_n):
10094 Remove unnecessary aborts (Bug#9081).
10096 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10098 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10099 has no `load' handler, try opening the file locally. (Bug#9311)
10101 2011-08-16 Ken Brown <kbrown@cornell.edu>
10103 * gmalloc.c: Expand comment.
10105 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10107 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10108 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10110 2011-08-16 Ken Brown <kbrown@cornell.edu>
10112 Fix memory allocation problems in Cygwin build (Bug#9273).
10114 * unexcw.c ( __malloc_initialized): Declare external variable.
10115 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10117 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10119 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10121 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10122 in the static heap.
10123 [CYGWIN] (special_realloc): New function.
10124 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10125 requests to realloc storage in the static heap.
10127 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10129 * bidi.c (bidi_initialize): Remove unused local.
10131 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10134 * biditype.h: Remove file.
10135 * makefile.w32-in ($(BLD)/bidi.$(O)):
10136 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10138 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10140 * chartab.c: Improve commentary for the uniprop_table API.
10142 * bidi.c (bidi_paragraph_init): Support zero value of
10143 bidi_ignore_explicit_marks_for_paragraph_level.
10144 (bidi_initialize): Use uniprop_table instead of including
10145 biditype.h and bidimirror.h.
10147 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10148 coordinates of the iterator when restoring from ppos_it.
10151 2011-08-14 Kenichi Handa <handa@m17n.org>
10153 * process.c (create_process): Call setup_process_coding_systems
10154 after the pid of the process is set to -1 (Bug#8162).
10156 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10158 * xdisp.c (move_it_in_display_line_to): Don't invoke
10159 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10160 ppos_it. Fixes vertical cursor motion when line beginning is
10161 covered by an image. (Bug#9296)
10163 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10165 * nsterm.h (ns_run_ascript): Declare.
10166 (NSAPP_DATA2_RUNASSCRIPT): Define.
10168 * nsfns.m (as_script, as_result, as_status): New static variables.
10169 (ns_run_ascript): New function.
10170 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10171 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10172 the event loop. Get status from as_status (Bug#7276).
10174 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10175 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10176 the event loop (Bug#7276).
10178 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10180 * gnutls.c (QCgnutls_bootprop_priority)
10181 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10182 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10183 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10184 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10185 (QCgnutls_bootprop_verify_hostname_error)
10186 (QCgnutls_bootprop_callbacks_verify): Rename from
10187 Qgnutls_bootprop_..., all uses changed.
10189 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10192 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10194 * xfaces.c (Qframe_set_background_mode): Now static.
10195 * dispextern.h (Qframe_set_background_mode): Remove decl.
10197 * process.c (Fnetwork_interface_info): Declare local only if needed.
10199 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10201 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10202 (Fnetwork_interface_list): Allocate in increments of bytes instead
10203 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10204 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10206 (struct ifflag_def): notrailers is smart on OSX.
10207 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10208 Get hardware address with getifaddrs if available.
10210 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10212 * xdisp.c (iterate_out_of_display_property): xassert that
10213 IT->position is set to within IT->object's boundaries. Break from
10214 the loop as soon as EOB is reached; avoids infloops in redisplay
10215 when IT->position is set up wrongly due to some bug.
10216 Set IT->current to match the bidi iterator unconditionally.
10217 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10218 entry. Force push_it to save on the stack the current
10219 buffer/string position, to be restored by pop_it. Fix flags in
10220 the iterator structure wrt the object coming from a display
10221 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10222 properties. (Bug#9284)
10224 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10226 * fontset.c (fontset_get_font_group): Add proper type checks.
10229 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10231 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10232 and LC_VERSION_MIN_MACOSX.
10233 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10234 (dump_it) [LC_FUNCTION_STARTS]: Use it.
10236 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10238 * xdisp.c (forward_to_next_line_start): Allow to use the
10239 no-display-properties-and-no-overlays under bidi display.
10240 Set disp_pos in the bidi iterator to avoid searches for display
10241 properties and overlays.
10243 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10245 * editfns.c (Fset_time_zone_rule): Document relationship with the
10248 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10249 the font entity extracted from the cache (Bug#8109).
10251 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10253 * composite.c (autocmp_chars): Don't reset point. That is done by
10254 restore_point_unwind (Bug#5984).
10256 2011-08-07 Juri Linkov <juri@jurta.org>
10258 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10259 to show the arg `TIME' instead of `TIMEVAL'.
10261 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10263 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10264 display property strides EOL and includes a newline, as in
10265 longlines-mode. (Bug#9254)
10266 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10267 word-wrap under bidirectional display. (Bug#9224)
10269 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10270 is non-zero, even if the data buffer is NULL. Fixes a crash in
10271 vertical-motion with longlines-mode. (Bug#9254)
10273 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10275 * bidi.c <bidi_cache_total_alloc>: Now static.
10276 (bidi_initialize): Initialize bidi_cache_total_alloc.
10278 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10281 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10282 amount allocated this far in `bidi_cache_total_alloc'.
10283 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10284 non-zero, only free the data buffer without restoring the cache
10285 contents. All callers changed.
10287 * dispextern.h (bidi_unshelve_cache): Update prototype.
10289 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10290 (move_it_in_display_line, move_it_to)
10291 (move_it_vertically_backward, move_it_by_lines): Replace the call
10292 to xfree to an equivalent call to bidi_unshelve_cache.
10293 (move_it_in_display_line_to): Fix logic of returning
10294 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
10296 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10298 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10299 came from a string character with a `cursor' property. (Bug#9229)
10301 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10303 * Makefile.in (LIB_PTHREAD): New variable.
10304 (LIBES): Add LIB_PTHREAD (Bug#9216).
10306 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10307 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10309 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10311 * regex.c (re_iswctype): Remove some redundant boolean conversions.
10313 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10315 * xterm.c (x_find_topmost_parent): New function.
10316 (x_set_frame_alpha): Find topmost parent window with
10317 x_find_topmost_parent and set the property there also (bug#9181).
10318 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10320 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10322 * callproc.c (Fcall_process): Avoid vfork clobbering
10323 the local vars buffer, coding_systems, current_dir.
10325 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10327 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10329 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10331 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10332 so that it is not optimized away.
10334 * xdisp.c (compute_display_string_pos): Remove unused local.
10336 2011-08-02 Eli Zaretskii <eliz@gnu.org>
10338 Fix slow cursor motion and scrolling in large buffers with
10339 selective display, like Org Mode buffers. (Bug#9218)
10341 * dispextern.h (struct bidi_it): New member disp_prop_p.
10343 * xdisp.c: Remove one-slot cache of display string positions.
10344 (compute_display_string_pos): Accept an additional argument
10345 DISP_PROP_P; callers changed. Scan at most 5K characters forward
10346 for a display string or property. If found, set DISP_PROP_P
10349 * bidi.c (bidi_fetch_char): Accept an additional argument
10350 DISP_PROP_P, and pass it to compute_display_string_pos.
10351 Only handle text covered by a display string if DISP_PROP_P is returned
10352 non-zero. All callers of bidi_fetch_char changed.
10354 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10356 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10358 2010-12-03 Don March <don@ohspite.net>
10360 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10361 last character M-[char] is translated to ESC [char] (bug#7541).
10363 2011-08-02 Kenichi Handa <handa@m17n.org>
10365 * lisp.h (uniprop_table): Extern it.
10367 * chartab.c (uniprop_table): Make it non-static.
10369 2011-08-01 Eli Zaretskii <eliz@gnu.org>
10371 * xdisp.c (forward_to_next_line_start): Accept additional argument
10372 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10374 (reseat_at_next_visible_line_start): Use the bidi iterator state
10375 returned by forward_to_next_line_start to restore the state of
10376 it->bidi_it after backing up to previous newline. (Bug#9212)
10378 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10380 * regex.c (re_comp): Protoize.
10381 (re_exec): Fix return type.
10382 (regexec): Fix type of `ret'. (Bug#9203)
10384 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10386 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10387 This is needed if max-image-size is a floating-point number.
10389 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10391 * print.c (print_object): Print empty symbol as ##.
10393 * lread.c (read1): Read ## as empty symbol.
10395 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10397 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10398 setting frame foreground color (Bug#9175).
10399 (x_set_background_color): Likewise.
10401 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10402 contents (Bug#9176).
10403 (EmacsTooltip -init): Remove bezels and add shadows to
10406 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10407 or scroll bar (Bug#8470).
10409 * nsfont.m (nsfont_open): Remove assignment to voffset and
10410 unnecessary vars hshink, expand, hd, full_height, min_height.
10411 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10413 * nsterm.h (nsfont_info): Remove voffset field.
10415 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10417 Implement strike-through and overline on NextStep (Bug#8863).
10419 * nsfont.m (nsfont_open): Use underline position provided by font,
10420 instead of hard-coded value of 2.
10421 (nsfont_draw): Call ns_draw_text_decoration instead.
10423 * nsterm.h: Add declaration for ns_draw_text_decoration.
10425 * nsterm.m (ns_draw_text_decoration): New function for drawing
10426 underline, overline, and strike-through.
10427 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10428 ns_draw_text_decoration. Change treatment of cursor drawing to
10429 accommodate underlining, etc.
10431 2011-07-28 Eli Zaretskii <eliz@gnu.org>
10433 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10436 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10438 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10439 Without this fix, if a signal arrives just after memory fills up,
10440 'malloc' might be invoked reentrantly.
10442 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10443 In other words, assume that every image size is allowed, on non-X
10444 hosts. This assumption is probably wrong, but it lets Emacs compile.
10446 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10448 * regex.c (re_iswctype): Convert return values to boolean.
10450 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10452 * xdisp.c (compute_display_string_pos): Don't use cached display
10453 string position if the buffer had its restriction changed.
10456 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10458 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10460 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10462 Integer signedness and overflow and related fixes. (Bug#9079)
10464 * bidi.c: Integer size and overflow fixes.
10465 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10466 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10467 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10468 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10469 (bidi_find_other_level_edge):
10470 Use ptrdiff_t instead of EMACS_INT where either will do.
10471 This works better on 32-bit hosts configured --with-wide-int.
10472 (bidi_cache_ensure_space): Check for size-calculation overflow.
10473 Use % rather than repeated addition, for better worst-case speed.
10474 Don't set bidi_cache_size until after xrealloc returns, because it
10476 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
10477 (bidi_cache_ensure_space): Also check that the bidi cache size
10478 does not exceed that of the largest Lisp string or buffer. See Eli
10479 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
10481 * alloc.c (__malloc_size_t): Remove.
10482 All uses replaced by size_t. See Andreas Schwab's note
10483 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10485 * image.c: Improve checking for integer overflow.
10486 (check_image_size): Assume that f is nonnull, since
10487 it is always nonnull in practice. This is one less thing to
10488 worry about when checking for integer overflow later.
10489 (x_check_image_size): New function, which checks for integer
10490 overflow issues inside X.
10491 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10492 This removes the need for a memory_full check.
10493 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10494 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10495 (xbm_read_bitmap_data): Change locals back to 'int', since
10496 their values must fit in 'int'.
10497 (xpm_load_image, png_load, tiff_load):
10498 Invoke x_create_x_image_and_pixmap earlier,
10499 to avoid much needless work if the image is too large.
10500 (tiff_load): Treat overly large images as if
10501 x_create_x_image_and_pixmap failed, not as malloc failures.
10502 (gs_load): Use x_check_image_size.
10504 * gtkutil.c: Omit integer casts.
10505 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10506 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10508 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10510 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10511 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10512 would wrongly return t on a 64-bit host.
10514 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10515 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10516 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10517 and therefore cause GCC to emit a bogus diagnostic in some cases.
10519 * image.c: Integer signedness and overflow and related fixes.
10520 This is not an exhaustive set of fixes, but it's time to
10521 record what I've got.
10522 (lookup_pixel_color, check_image_size): Remove redundant decls.
10523 (check_image_size): Don't assume that arbitrary EMACS_INT values
10524 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10525 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10526 (tiff_load, imagemagick_load_image):
10527 Check for overflow in size calculations.
10528 (x_create_x_image_and_pixmap): Remove unnecessary test for
10529 xmalloc returning NULL; that can't happen.
10530 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10531 (xpm_color_bucket): Use better integer hashing function.
10532 (xpm_cache_color): Don't possibly over-allocate memory.
10533 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10534 (gif_memory_source):
10535 Use ptrdiff_t, not int or size_t, to record sizes.
10536 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10537 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10538 either works, as we prefer signed integers.
10539 (tiff_read_from_memory, tiff_write_from_memory):
10540 Return tsize_t, not size_t, since that's what the TIFF API wants.
10541 (tiff_read_from_memory): Don't fail simply because the read would
10542 go past EOF; instead, return a short read.
10543 (tiff_load): Omit no-longer-needed casts.
10544 (Fimagemagick_types): Don't assume size fits into 'int'.
10546 Improve hashing quality when configured --with-wide-int.
10547 * fns.c (hash_string): New function, taken from sxhash_string.
10548 Do not discard information about ASCII character case; this
10549 discarding is no longer needed.
10550 (sxhash-string): Use it. Change sig to match it. Caller changed.
10551 * lisp.h: Declare it.
10552 * lread.c (hash_string): Remove, since we now use fns.c's version.
10553 The fns.c version returns a wider integer if --with-wide-int is
10554 specified, so this should help the quality of the hashing a bit.
10556 * emacs.c: Integer overflow minor fix.
10557 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10558 Define only if GNU_LINUX.
10559 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10561 * dispnew.c: Integer signedness and overflow fixes.
10562 Remove unnecessary forward decls, that were a maintenance hassle.
10563 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10565 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10566 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10567 (prepare_desired_row, line_draw_cost):
10568 Use int, not unsigned, where either works.
10569 (save_current_matrix, restore_current_matrix):
10570 Use ptrdiff_t, not size_t, where either works.
10571 (init_display): Check for overflow more accurately, and without
10572 relying on undefined behavior.
10574 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10575 Remove, replacing with the new symbols in lisp.h. All uses changed.
10576 * fileio.c (make_temp_name):
10577 * filelock.c (lock_file_1, lock_file):
10578 * xdisp.c (message_dolog):
10579 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10580 Use pMd etc. instead.
10581 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10582 replacing the pWIDE etc. symbols removed from editfns.c.
10584 * keyboard.h (num_input_events): Now uintmax_t.
10585 This is (very slightly) less likely to mess up due to wraparound.
10588 * buffer.c: Integer signedness fixes.
10589 (alloc_buffer_text, enlarge_buffer_text):
10590 Use ptrdiff_t rather than size_t when either will do, as we prefer
10593 * alloc.c: Integer signedness and overflow fixes.
10594 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10595 (__malloc_size_t): Default to size_t, not to int.
10596 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10597 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10598 Prefer ptrdiff_t to size_t when either would do, as we prefer
10600 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10601 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10602 Now const. Initialize with values that are in range even if char
10604 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10605 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10606 These functions do the right thing with sizes > 2**32.
10607 (check_depth): Now ptrdiff_t, not int.
10608 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10609 Adjust to new way of storing sizes. Check for size overflow bugs
10611 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10612 slightly wrong anyway, as it missed one instance of
10613 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10614 (refill_memory_reserve): Omit needless cast to size_t.
10615 (mark_object_loop_halt): Mark as externally visible.
10617 * xselect.c: Integer signedness and overflow fixes.
10618 (Fx_register_dnd_atom, x_handle_dnd_message):
10619 Use ptrdiff_t, not size_t, since we prefer signed.
10620 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10621 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10622 x_dnd_atoms_size and x_dnd_atoms_length.
10624 * doprnt.c: Prefer signed to unsigned when either works.
10626 * doprnt.c (doprnt):
10628 * xdisp.c (vmessage):
10629 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10630 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10631 prefer signed arithmetic to avoid comparison confusion.
10632 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10633 but is a bit tricky.
10635 Assume freestanding C89 headers, string.h, stdlib.h.
10636 * data.c, doprnt.c, floatfns.c, print.c:
10637 Include float.h unconditionally.
10638 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10639 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10640 * regex.c: Likewise for stddef.h, string.h.
10641 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10642 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10643 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10644 (STDC_HEADERS): Remove obsolete defines.
10645 * sysdep.c: Include limits.h unconditionally.
10647 Assume support for memcmp, memcpy, memmove, memset.
10648 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10649 * regex.c (memcmp, memcpy):
10650 Remove; we assume C89 now.
10652 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10653 (__malloc_safe_bcopy): Remove; no longer needed.
10655 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
10656 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10657 well either way, and we prefer signed to unsigned.
10659 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10661 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10662 closes the connection while we're reading (bug#9182).
10664 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
10666 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10667 are specified (Bug#9168).
10669 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10671 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10672 Found by GCC static checking and --with-wide-int on a 32-bit host.
10674 2011-07-25 Eli Zaretskii <eliz@gnu.org>
10676 * xdisp.c (compute_display_string_pos): Fix logic of caching
10677 previous display string position. Initialize cached_prev_pos to
10678 -1. Fixes slow-down at the beginning of a buffer.
10680 2011-07-24 Eli Zaretskii <eliz@gnu.org>
10682 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10683 for attrs[LFACE_FONTSET_INDEX].
10685 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10687 * xml.c (parse_region): Remove unused local
10688 that was recently introduced.
10690 2011-07-23 Eli Zaretskii <eliz@gnu.org>
10692 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10693 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10695 * xdisp.c (move_it_in_display_line_to): Record the best matching
10696 position for TO_CHARPOS while scanning the line, and restore it on
10697 exit if none of the characters scanned was an exact match.
10698 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
10699 when exact match is impossible due to invisible text, and the
10700 lines are truncated.
10702 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10704 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10707 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10709 Fix a significant slow-down of cursor motion with C-n, C-p,
10710 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10711 auto-repeat under bidi redisplay in fontified buffers.
10712 * xdisp.c (compute_stop_pos_backwards): New function.
10713 (next_element_from_buffer): Call compute_stop_pos_backwards to
10714 find a suitable prev_stop when we find ourselves before
10716 (reseat): Don't look for prev_stop, as that could mean a very long
10718 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10719 <cached_disp_overlay_modiff>: Cache for last found display string
10721 (compute_display_string_pos): Return the cached position if asked
10722 about the same buffer in the same area of character positions, and
10723 the buffer wasn't changed since the time the display string
10724 position was cached.
10726 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10728 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10729 is an integer, which is important for empty lines. (Bug#9149)
10731 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
10733 * frame.c (Fmodify_frame_parameters): In tty case, update the
10734 default face if necessary (Bug#4238).
10736 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
10738 * editfns.c (Fstring_to_char): No need to explain what a character
10739 is in the docstring (Bug#6576).
10741 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10743 * xml.c (parse_region): Make sure we always return a tree.
10745 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10747 * xml.c (parse_region): If a document contains only comments,
10750 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10752 * xml.c (make_dom): Return comments, too.
10754 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10757 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10758 and the surrounding thread.
10759 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10760 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10761 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10763 * s/openbsd.h (BROKEN_SIGIO): Define.
10764 * unexelf.c (unexec) [__OpenBSD__]:
10765 Don't update the .mdebug section of the Alpha COFF symbol table.
10767 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10769 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10772 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10774 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10775 This fixes some race conditions on the permissions of any newly
10778 * alloc.c (valid_pointer_p): Use pipe, not open.
10779 This fixes some permissions issues when debugging.
10781 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10782 If fchown fails to set both uid and gid, try to set just gid,
10783 as that is sometimes allowed. Adjust the file's mode to eliminate
10784 setuid or setgid bits that are inappropriate if fchown fails.
10786 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10788 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10789 to compare Lisp_Objects.
10790 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10791 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10792 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10794 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10796 * lread.c (read_integer): Unread even EOF character.
10797 (read1): Likewise. Properly record start position of symbol.
10799 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10800 symbol character follows.
10802 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10804 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10805 This works around a problem with the previous change to Fcopy_file.
10806 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10807 and without this change, GCC might complain about discarding
10808 fchown's return value.
10810 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
10812 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10814 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10816 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10818 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10820 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10821 it's used from the C level.
10823 * process.c: Use the same condition for POLL_FOR_INPUT in both
10824 keyboard.c and process.c (bug#1858).
10826 2011-07-09 Lawrence Mitchell <wence@gmx.li>
10828 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10829 (Fgnutls_boot): Use it.
10831 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10833 * doc.c (Fsubstitute_command_keys): Revert last change.
10835 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10837 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10838 quotes the next character, and doesn't affect other longer
10839 sequences (bug#8935).
10841 * lread.c (syms_of_lread): Clarify that is isn't only
10842 `eval-buffer' and `eval-defun' that's affected by
10843 `lexical-binding' (bug#8460).
10845 2011-07-15 Eli Zaretskii <eliz@gnu.org>
10847 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
10848 bidi redisplay when a line includes both an image and is truncated.
10850 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10852 Fix minor problems found by static checking.
10853 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10854 (elsz): Now a signed constant, not a size_t var. We prefer signed
10855 types to unsigned, to avoid integer comparison confusion. Without
10856 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10857 "cannot optimize loop, the loop counter may overflow", a symptom
10859 * indent.c (Fvertical_motion): Mark locals as initialized.
10860 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10862 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10864 * search.c (Fre_search_backward): Mention `case-fold-search' in
10865 all the re_search_* functions (bug#8138).
10867 * keyboard.c (Fopen_dribble_file): Document when the file is
10870 2011-07-14 Eli Zaretskii <eliz@gnu.org>
10872 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10875 Support bidi reordering of display and overlay strings.
10876 * xdisp.c (compute_display_string_pos)
10877 (compute_display_string_end): Accept additional argument STRING.
10878 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10879 (reseat_to_string): Initialize bidi_it->string.s and
10880 bidi_it->string.schars.
10881 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
10882 NULL (avoids a crash in bidi_paragraph_init).
10883 Initialize itb.string.lstring.
10884 (init_iterator): Call bidi_init_it only of a valid
10885 buffer position was specified. Initialize paragraph_embedding to
10887 (reseat_to_string): Initialize the bidi iterator.
10888 (display_string): If we need to ignore text properties of
10889 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10890 original value of -1 will not work with bidi.)
10891 (compute_display_string_pos): First arg is now struct
10892 `text_pos *'; all callers changed. Support display properties on
10894 (compute_display_string_end): Support display properties on Lisp
10896 (init_iterator, reseat_1, reseat_to_string): Initialize the
10897 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10898 when iterating on a string not from display properties).
10899 (compute_display_string_pos, compute_display_string_end):
10900 Fix calculation of the object to scan. Fixes an error when using
10902 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
10903 base_level_stop; instead, set base_level_stop to BEGV.
10904 Fixes crashes in vertical-motion.
10905 (next_element_from_buffer): Improve commentary for when
10906 the iterator is before prev_stop.
10907 (init_iterator): Initialize bidi_p from the default value of
10908 bidi-display-reordering, not from buffer-local value. Use the
10909 buffer-local value only if initializing for buffer iteration.
10910 (handle_invisible_prop): Support invisible properties on strings
10911 that are being bidi-reordered.
10912 (set_iterator_to_next): Support bidi reordering of C strings and
10914 (next_element_from_string): Support bidi reordering of Lisp
10916 (handle_stop_backwards): Support Lisp strings as well.
10917 (display_string): Support display of R2L glyph rows.
10918 Use IT_STRING_CHARPOS when displaying from a Lisp string.
10919 (init_iterator): Don't initialize it->bidi_p for strings
10921 (reseat_to_string): Initialize it->bidi_p for strings here.
10922 (next_element_from_string, next_element_from_c_string)
10923 (next_element_from_buffer): Add xassert's for correspondence
10924 between IT's object being iterated and it->bidi_it.string
10926 (face_before_or_after_it_pos): Support bidi iteration.
10927 (next_element_from_c_string): Handle the case of the first string
10928 character that is not the first one in the visual order.
10929 (get_visually_first_element): New function, refactored from common
10930 parts of next_element_from_buffer, next_element_from_string, and
10931 next_element_from_c_string.
10932 (tool_bar_lines_needed, redisplay_tool_bar)
10933 (display_menu_bar): Force left-to-right direction. Add a FIXME
10934 comment for making that be controlled by a user option.
10935 (push_it, pop_it): Save and restore the state of the
10936 bidi iterator. Save and restore the bidi_p flag.
10937 (pop_it): Iterate out of display property for string iteration as
10939 (iterate_out_of_display_property): Support iteration over strings.
10940 (handle_single_display_spec): Set up it->bidi_it for iteration
10941 over a display string, and call bidi_init_it.
10942 (handle_single_display_spec, next_overlay_string)
10943 (get_overlay_strings_1, push_display_prop): Set up the bidi
10944 iterator for displaying display or overlay strings.
10945 (forward_to_next_line_start): Don't use the shortcut if
10947 (back_to_previous_visible_line_start): If handle_display_prop
10948 pushed the iterator stack, restore the internal state of the bidi
10949 iterator by calling bidi_pop_it same number of times.
10950 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10951 and we are bidi-iterating, don't decrement the iterator position;
10952 instead, set the first_elt flag in the bidi iterator, to produce
10954 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10955 (push_display_prop): xassert that we are iterating a buffer.
10956 (push_it, pop_it): Save and restore paragraph_embedding member.
10957 (handle_single_display_spec, next_overlay_string)
10958 (get_overlay_strings_1, reseat_1, reseat_to_string)
10959 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10960 correctly. Don't assume unibyte strings are not bidi-reordered.
10961 (compute_display_string_pos)
10962 (compute_display_string_end): Fix handling the case of C string.
10963 (push_it, pop_it): Save and restore from_disp_prop_p.
10964 (handle_single_display_spec, push_display_prop): Set the
10965 from_disp_prop_p flag.
10966 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10967 (pop_it): Call iterate_out_of_display_property only if we are
10968 popping after iteration over a string that came from a display
10969 property. Fix a typo in popping stretch info. Add an assertion
10970 for verifying that the iterator position is in sync with the bidi
10972 (handle_single_display_spec, get_overlay_strings_1)
10973 (push_display_prop): Fix initialization of paragraph direction for
10974 string when that of the parent object is not yet determined.
10975 (reseat_1): Call bidi_init_it to resync the bidi
10976 iterator with IT's position. (Bug#7616)
10977 (find_row_edges): If ROW->start.pos gives position
10978 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10979 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10980 Reset the from_disp_prop_p flag.
10981 (SAVE_IT, RESTORE_IT): New macros.
10982 (pos_visible_p, face_before_or_after_it_pos)
10983 (back_to_previous_visible_line_start)
10984 (move_it_in_display_line_to, move_it_in_display_line)
10985 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10986 (try_scrolling, redisplay_window, display_line): Use them when
10987 saving a temporary copy of the iterator and restoring it back.
10988 (back_to_previous_visible_line_start, reseat_1)
10989 (init_iterator): Empty the bidi cache "stack".
10990 (move_it_in_display_line_to): If iterator ended up at
10991 EOL, but we never saw any buffer positions smaller than
10992 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10993 motion in bidi-reordered lines.
10994 (move_it_in_display_line_to): Record prev_method and prev_pos
10995 immediately before the call to set_iterator_to_next. Fixes cursor
10996 motion in bidi-reordered lines with stretch glyphs and strings
10997 displayed in margins. (Bug#8133) (Bug#8867)
10998 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11000 (pos_visible_p): Support positions in bidi-reordered lines.
11001 Save and restore bidi cache.
11003 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11004 (bidi_paragraph_info): Delete unused struct.
11005 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11006 (bidi_cache_start): New variable.
11007 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11009 (bidi_cache_fetch_state, bidi_cache_search)
11010 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11011 (bidi_cache_find, bidi_peek_at_next_level)
11012 (bidi_level_of_next_char, bidi_find_other_level_edge)
11013 (bidi_move_to_visually_next): Compare cache index with
11014 bidi_cache_start rather than with zero.
11015 (bidi_fetch_char): Accept new argument STRING; all callers
11016 changed. Support iteration over a string. Support strings with
11017 display properties. Support unibyte strings. Fix the type of
11018 `len' according to what STRING_CHAR_AND_LENGTH expects.
11019 (bidi_paragraph_init, bidi_resolve_explicit_1)
11020 (bidi_resolve_explicit, bidi_resolve_weak)
11021 (bidi_level_of_next_char, bidi_move_to_visually_next):
11022 Support iteration over a string.
11023 (bidi_set_sor_type, bidi_resolve_explicit_1)
11024 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11025 can now be zero (for strings); special values 0 and -1 were
11026 changed to -1 and -2, respectively.
11027 (bidi_char_at_pos): New function.
11028 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11029 Call it instead of FETCH_MULTIBYTE_CHAR.
11030 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11031 initialized to valid values.
11032 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11034 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11035 the test for valid cached positions. Fix the logic for looking up
11036 the sentinel state in the cache. GCPRO the Lisp string we are
11038 (bidi_push_it, bidi_pop_it): New functions.
11039 (bidi_initialize): Initialize the bidi cache start stack pointer.
11040 (bidi_cache_ensure_space): New function, refactored from part of
11041 bidi_cache_iterator_state. Don't assume the required size is just
11042 one BIDI_CACHE_CHUNK away.
11043 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11044 (bidi_count_bytes, bidi_char_at_pos): New functions.
11045 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11046 always valid if bidi_cache_idx is valid.
11047 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11048 is valid if it's going to be used.
11049 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11050 (bidi_cache_fetch_state, bidi_cache_search)
11051 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11052 (bidi_cache_iterator_state, bidi_cache_find)
11053 (bidi_find_other_level_edge, bidi_cache_start_stack):
11054 All variables related to cache indices are now EMACS_INT.
11056 * dispextern.h (struct bidi_string_data): New structure.
11057 (struct bidi_it): New member `string'. Make flag members be 1-bit
11058 fields, and put them last in the struct.
11059 (compute_display_string_pos, compute_display_string_end):
11061 (bidi_push_it, bidi_pop_it): Add prototypes.
11062 (struct iterator_stack_entry): New members bidi_p,
11063 paragraph_embedding, and from_disp_prop_p.
11064 (struct it): Member bidi_p is now a bit field 1 bit wide.
11065 (bidi_shelve_cache, bidi_unshelve_cache):
11066 Declare prototypes.
11068 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11069 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11070 and vector-like objects.
11072 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11073 cache around display iteration.
11075 * window.c (Fwindow_end, window_scroll_pixel_based)
11076 (displayed_window_lines, Frecenter): Save and restore the bidi
11077 cache around display iteration.
11079 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11081 * editfns.c (Fdelete_region): Clarify the use of the named
11082 parameters (bug#6788).
11084 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11086 * indent.c (Fvertical_motion): Set and restore w->pointm when
11087 saving and restoring the window's buffer (Bug#9006).
11089 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11091 * editfns.c (Fstring_to_char): Clarify just what is returned
11092 (bug#6576). Text by Eli Zaretskii.
11094 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11096 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11098 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11100 * buffer.c (mmap_find): Fix a typo.
11102 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11104 Fix execution of x selection hooks.
11105 * xselect.c (Qx_lost_selection_functions)
11106 (Qx_sent_selection_functions): New vars.
11107 (syms_of_xselect): DEFSYM them.
11108 (x_handle_selection_request): Pass Qx_sent_selection_functions
11109 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11110 (x_handle_selection_clear,x_clear_frame_selections):
11111 Pass Qx_lost_selection_functions rather than
11112 Vx_lost_selection_functions to Frun_hook_with_args.
11114 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11116 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11117 The old code sometimes used this field without initializing it.
11119 * alloc.c (gc_sweep): Don't read past end of array.
11120 In theory, the old code could also have corrupted Emacs internals,
11121 though it'd be very unlikely.
11123 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11125 * character.c (Fcharacterp): Don't advertise optional ignored
11126 argument. (Bug#4026)
11128 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11130 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11133 * window.c (Fset_window_start): Doc fix (bug#4199).
11134 (Fset_window_hscroll): Ditto.
11136 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11138 Fix minor new problems caught by GCC 4.6.1.
11139 * term.c (init_tty): Remove unused local.
11140 * xsettings.c (store_monospaced_changed): Define this function only
11141 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11142 not used otherwise.
11144 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11146 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11148 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11150 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11151 are the mini-buffer and the echo area (bug#3320).
11153 * term.c (init_tty): Remove support for supdup, c10 and perq
11154 terminals, which are no longer supported (bug#1482).
11156 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11158 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11160 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11162 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11163 for non-popups (Bug#3642).
11165 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11167 * alloc.c (reset_malloc_hooks): Protoize.
11168 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11169 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11170 * cm.c (losecursor): Likewise.
11171 * data.c (fmod): Likewise.
11172 * dispnew.c (swap_glyphs_in_rows): Likewise.
11173 * emacs.c (memory_warning_signal): Likewise.
11174 * floatfns.c (float_error): Likewise.
11175 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11176 (otf_open, font_otf_capability, generate_otf_features)
11177 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11179 * image.c (pbm_read_file): Likewise.
11180 * indent.c (string_display_width): Likewise.
11181 * intervals.c (check_for_interval, search_for_interval)
11182 (inc_interval_count, count_intervals, root_interval)
11183 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11184 * lread.c (defalias): Likewise.
11185 * ralloc.c (r_alloc_check): Likewise.
11186 * regex.c (set_image_of_range_1, set_image_of_range)
11187 (regex_grow_registers): Likewise.
11188 * sysdep.c (strerror): Likewise.
11189 * termcap.c (valid_filename_p, tprint, main): Likewise.
11190 * tparam.c (main): Likewise.
11191 * unexhp9k800.c (run_time_remap, save_data_space)
11192 (update_file_ptrs, read_header, write_header, calculate_checksum)
11193 (copy_file, copy_rest, display_header): Likewise.
11194 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11196 * xdisp.c (check_it): Likewise.
11197 * xfaces.c (register_color, unregister_color, unregister_colors):
11199 * xfns.c (print_fontset_result): Likewise.
11200 * xrdb.c (member, fatal, main): Likewise.
11202 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11204 Fix minor problems found by static checking (Bug#9031).
11205 * chartab.c (char_table_set_range, map_sub_char_table):
11206 Remove unused locals.
11207 (uniprop_table): Now static.
11208 * composite.c (_work_char): Remove unused static var.
11210 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11212 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11214 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11216 * gtkutil.c (qttip_cb): Remove code without function.
11218 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11220 * w32.c (pthread_sigmask): New stub.
11222 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11224 Use pthread_sigmask, not sigprocmask (Bug#9010).
11225 sigprocmask is portable only for single-threaded applications, and
11226 Emacs can be multi-threaded when it uses GTK.
11227 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11229 * callproc.c (Fcall_process):
11230 * process.c (create_process):
11231 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11232 Use pthread_sigmask, not sigprocmask.
11234 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11236 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11237 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11240 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11242 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11243 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11244 (xg_hide_tooltip): Fix comment.
11246 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11247 in registerServicesMenuSendTypes.
11248 (validRequestorForSendType): Don't check ns_return_types.
11250 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11253 2011-07-08 Jason Rumney <jasonr@gnu.org>
11255 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11256 SH_SHOW for hidden windows (Bug#5482).
11258 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11259 frame struct members of non-existent frames (Bug#6284).
11261 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11263 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11264 variable firstTime not needed on OSX >= 10.6.
11265 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11266 >= 10.5. Use setKnobProportion, setDoubleValue.
11268 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11269 (MAC_OS_X_VERSION_10_5): Define if not defined.
11270 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11271 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11272 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11274 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11275 cString and lossyCString on OSX >= 10.4.
11277 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11278 sizeToFit on OSX >= 10.2.
11280 * nsimage.m (allocInitFromFile): Don't use deprecated method
11281 bestRepresentationForDevice on OSX >= 10.6.
11283 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11286 * emacs.c: Declare unexec_init_emacs_zone.
11288 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11290 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11292 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11293 on svcsMenu (Bug#8842).
11295 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11297 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11299 * nsterm.m (QUTF8_STRING): Declare.
11300 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11301 (validRequestorForSendType): Return type is (id).
11302 Change indexOfObjectIdenticalTo to indexOfObject.
11303 Check if we have local selection before returning self (Bug#8842).
11304 (writeSelectionToPasteboard): Put local selection into paste board
11305 if we have a local selection (Bug#8842).
11306 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11308 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11309 (ns_get_local_selection): Declare.
11311 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11313 * keymap.c (describe_map_tree): Don't insert a double newline at
11314 the end of the buffer (bug#1169) and return whether we inserted
11317 * callint.c (Fcall_interactively): Change "reading args" to
11318 "providing args" to try to clarify what it does (bug#1010).
11320 2011-07-07 Kenichi Handa <handa@m17n.org>
11322 * composite.c (composition_compute_stop_pos): Ignore a static
11323 composition starting before CHARPOS (Bug#8915).
11325 * xdisp.c (handle_composition_prop): Likewise.
11327 2011-07-07 Eli Zaretskii <eliz@gnu.org>
11329 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11332 2011-07-07 Kenichi Handa <handa@m17n.org>
11334 * character.h (unicode_category_t): New enum type.
11336 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11337 (Qchar_code_property_table): New variable.
11338 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11339 (UNIPROP_COMPRESSED_FORM_P): New macros.
11340 (char_table_ascii): Uncompress the compressed values.
11341 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11342 Uncompress the compressed values.
11343 (sub_char_table_ref_and_range): Likewise.
11344 (char_table_ref_and_range): Uncompress the compressed values.
11345 (sub_char_table_set): New arg is_uniprop. Callers changed.
11346 Uncompress the compressed values.
11347 (sub_char_table_set_range): Args changed. Callers changed.
11348 (char_table_set_range): Adjuted for the above change.
11349 (map_sub_char_table): Delete args default_val and parent. Add arg
11350 top. Give decoded values to a Lisp function.
11351 (map_char_table): Adjust for the above change. Give decoded
11352 values to a Lisp function. Gcpro more variables.
11353 (uniprop_table_uncompress)
11354 (uniprop_decode_value_run_length): New functions.
11355 (uniprop_decoder, uniprop_decoder_count): New variables.
11356 (uniprop_get_decoder, uniprop_encode_value_character)
11357 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11359 (uniprop_encoder, uniprop_encoder_count): New variables.
11360 (uniprop_get_encoder, uniprop_table)
11361 (Funicode_property_table_internal, Fget_unicode_property_internal)
11362 (Fput_unicode_property_internal): New functions.
11363 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11364 Sunicode_property_table_internal, Sget_unicode_property_internal,
11365 and Sput_unicode_property_internal. Defvar_lisp
11366 char-code-property-alist.
11368 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11369 Vunicode_category_table.
11371 * font.c (font_range): Adjust for the change of
11372 Vunicode_category_table.
11374 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11376 * m/iris4d.h: Remove file, move contents ...
11377 * s/irix6-5.h: ... here.
11379 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11381 Remove unportable assumption about struct layout (Bug#8884).
11382 * alloc.c (mark_buffer):
11383 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11384 (clone_per_buffer_values): Don't assume that
11385 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11386 This isn't true in general, and it's particularly not true
11387 if Emacs is configured with --with-wide-int.
11388 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11389 New macros, used in the buffer.c change.
11391 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11393 * xsettings.c: Use both GConf and GSettings if both are available.
11394 (store_config_changed_event): Add comment.
11395 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11396 (store_tool_bar_style_changed): New functions.
11397 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
11398 (struct xsettings): Move font inside HAVE_XFT.
11399 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
11400 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
11401 Move inside HAVE_XFT.
11402 (something_changed_gsettingsCB): Rename from something_changedCB.
11403 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11405 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
11406 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
11407 (something_changed_gconfCB): Rename from something_changedCB.
11408 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11409 (parse_settings): Move check for font inside HAVE_XFT.
11410 (read_settings, apply_xft_settings): Add comment.
11411 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11412 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11413 call store_font_name_changed.
11414 (xft_settings_event): Add comment.
11415 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11416 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11417 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11418 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11419 (xsettings_initialize): Call init_gsettings last.
11420 (xsettings_get_system_font, xsettings_get_system_normal_font):
11423 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11425 Random fixes. E.g., (random) never returned negative values.
11426 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11427 subseconds part to the entropy, as that's a bit more random.
11428 Prefer signed to unsigned, since the signedness doesn't matter and
11429 in general we prefer signed. When given a limit, use a
11430 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11431 latter isn't right if USE_2_TAGS_FOR_INTS.
11432 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11433 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11435 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11437 * textprop.c (text_property_stickiness):
11438 Obey Vtext_property_default_nonsticky.
11439 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11440 * w32fns.c (syms_of_w32fns):
11441 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11443 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11445 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11446 This is more efficient than Ffile_directory_p and avoids a minor race.
11448 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11450 * buffer.c (Foverlay_put): Say what the return value is
11453 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11454 is a directory before asking whether to use the file name
11456 (barf_or_query_if_file_exists): Make the "File is a directory"
11457 error be more correct.
11459 * fns.c (Frequire): Remove the mention of the .gz files, since
11460 that's installation-specific, but keep the mention of
11461 `get-load-suffixes'.
11463 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11465 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11466 Report string overflow if the output is too long.
11468 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
11470 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11471 (syms_of_gnutls): Remove duplicate DEFSYM for
11472 Qgnutls_bootprop_verify_hostname_error, an error for
11473 Qgnutls_bootprop_verify_error (which is no longer used).
11475 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11476 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11477 Also (re)move comments that are misplaced or no longer relevant.
11479 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11481 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11483 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
11485 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11486 and background color parameters if they have been changed.
11488 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11490 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11492 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11494 * xsettings.c (SYSTEM_FONT): Define only when used.
11495 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11497 * keymap.c (access_keymap_1): Now static.
11499 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
11501 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11502 leave any prefix arg for the up event (Bug#1586).
11504 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11506 * lread.c (syms_of_lread): Mention single symbols defined by
11507 `defvar' or `defconst' (bug#7154).
11509 * fns.c (Frequire): Mention .el.gz files (bug#7314).
11510 (Frequire): Mention get-load-suffixes.
11512 2011-07-02 Martin Rudalics <rudalics@gmx.at>
11514 * window.h (window): Remove clone_number slot.
11515 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11517 (make_parent_window, make_window, saved_window)
11518 (Fset_window_configuration, save_window_save): Don't deal with
11520 * buffer.c (Qclone_number): Remove declaration.
11521 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11523 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11525 Add multiple inheritance to keymaps.
11526 * keymap.c (Fmake_composed_keymap): New function.
11527 (Fset_keymap_parent): Simplify.
11528 (fix_submap_inheritance): Remove.
11529 (access_keymap_1): New function extracted from access_keymap to handle
11530 embedded parents and handle lists of maps.
11531 (access_keymap): Use it.
11532 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11533 (Fcopy_keymap): Handle embedded parents.
11534 (Fcommand_remapping, define_as_prefix): Simplify.
11535 (Fkey_binding): Simplify.
11536 (syms_of_keymap): Move minibuffer-local-completion-map,
11537 minibuffer-local-filename-completion-map,
11538 minibuffer-local-must-match-map, and
11539 minibuffer-local-filename-must-match-map to Elisp.
11540 (syms_of_keymap): Defsubr make-composed-keymap.
11541 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11542 (parse_menu_item): Trivial simplification.
11544 2011-07-01 Glenn Morris <rgm@gnu.org>
11546 * Makefile.in (SETTINGS_LIBS): Fix typo.
11548 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11550 * coding.c (Fencode_coding_string): Record the last coding system
11551 used, as the function doc string says (bug#8738).
11553 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11555 * xsettings.c (store_monospaced_changed): Take new font as arg and
11556 check for change against current_mono_font.
11557 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11558 (emacs_settings_constructor, emacs_settings_get_property)
11559 (emacs_settings_set_property, emacs_settings_class_init)
11560 (emacs_settings_init, gsettings_obj): Remove.
11561 (something_changedCB): New function for HAVE_GSETTINGS.
11562 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11563 with value as argument.
11564 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11565 g_settings_new (Bug#8967). Do not create gsettings_obj.
11566 Remove calls to g_settings_bind. Connect something_changedCB to
11569 * xgselect.c: Add defined (HAVE_GSETTINGS).
11570 (xgselect_initialize): Ditto.
11572 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11573 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11576 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11578 * eval.c (struct backtrace): Simplify and port the data structure.
11579 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11580 signed bit field, as this assumption is not portable and it makes
11581 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11582 "char debug_on_exit : 1" as this is not portable either; instead,
11583 use the portable "unsigned int debug_on_exit : 1". Remove unused
11584 member evalargs. Remove obsolete comments about cc bombing out.
11586 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11588 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
11589 Let HAVE_GSETTINGS override HAVE_GCONF.
11590 (store_monospaced_changed): New function.
11591 (EMACS_SETTINGS): A new type derived from GObject to handle
11592 GSettings notifications.
11593 (emacs_settings_constructor, emacs_settings_get_property)
11594 (emacs_settings_set_property, emacs_settings_class_init):
11596 (gsettings_client, gsettings_obj): New variables.
11597 (GSETTINGS_SCHEMA): New define.
11598 (something_changedCB): Call store_monospaced_changed.
11599 (init_gsettings): New function.
11600 (xsettings_initialize): Call init_gsettings.
11601 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11604 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
11607 2011-06-29 Martin Rudalics <rudalics@gmx.at>
11609 * window.c (resize_root_window, grow_mini_window)
11610 (shrink_mini_window): Rename Qresize_root_window to
11611 Qwindow_resize_root_window and Qresize_root_window_vertically to
11612 Qwindow_resize_root_window_vertically.
11614 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11616 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11618 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
11620 * makefile.w32-in: Redesign dependencies so they reflect more
11621 clearly which files are directly included by each source file,
11622 and not through other includes.
11624 2011-06-27 Martin Rudalics <rudalics@gmx.at>
11626 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11627 (sort_overlays, overlay_strings): When an overlay's clone number
11628 matches the window's clone number process the overlay even if
11629 the overlay's window property doesn't match the current window.
11631 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11632 (Fwindow_hchild): Rename to Fwindow_left_child.
11633 (Fwindow_next): Rename to Fwindow_next_sibling.
11634 (Fwindow_prev): Rename to Fwindow_prev_sibling.
11635 (resize_window_check): Rename to window_resize_check.
11636 (resize_window_apply): Rename to window_resize_apply.
11637 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11638 (Fdelete_other_windows_internal, resize_frame_windows)
11639 (Fsplit_window_internal, Fdelete_window_internal)
11640 (grow_mini_window, shrink_mini_window)
11641 (Fresize_mini_window_internal): Fix callers accordingly.
11643 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11645 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11646 (emacs_fixed_set_min_size): Remove.
11647 (emacs_fixed_new): Take frame as argument.
11649 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11650 (_EmacsFixedPrivate): Remove minwidth/height.
11651 Add struct frame *f.
11652 (emacs_fixed_init): Initialize priv->f.
11653 (get_parent_class, emacs_fixed_set_min_size): Remove.
11654 (emacs_fixed_new): Set priv->f to argument.
11655 (emacs_fixed_get_preferred_width)
11656 (emacs_fixed_get_preferred_height): Use min_width/height from
11657 frames size_hint to set minimum and natural (Bug#8919).
11658 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11659 and use min_width/height from frames size_hint to set
11660 min_width/height (Bug#8919).
11662 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
11663 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11666 2011-06-26 Eli Zaretskii <eliz@gnu.org>
11668 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11669 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11672 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
11674 * process.c (wait_reading_process_output): Bypass select if
11675 waiting for a cell while ignoring keyboard input, and input is
11676 pending. Suggested by Jan Djärv (Bug#8869).
11678 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11680 Use gnulib's dup2 module instead of rolling our own.
11681 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11683 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11685 * dispnew.c (scrolling_window): Before scrolling, turn off a
11686 mouse-highlight in the window being scrolled.
11688 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
11690 Move DEFSYM to lisp.h and use everywhere.
11692 * character.h (DEFSYM): Move declaration...
11693 * lisp.h (DEFSYM): ...here.
11699 * w32select.c: Don't include character.h.
11701 * alloc.c (syms_of_alloc):
11702 * buffer.c (syms_of_buffer):
11703 * bytecode.c (syms_of_bytecode):
11704 * callint.c (syms_of_callint):
11705 * casefiddle.c (syms_of_casefiddle):
11706 * casetab.c (init_casetab_once):
11707 * category.c (init_category_once, syms_of_category):
11708 * ccl.c (syms_of_ccl):
11709 * cmds.c (syms_of_cmds):
11710 * composite.c (syms_of_composite):
11711 * dbusbind.c (syms_of_dbusbind):
11712 * dired.c (syms_of_dired):
11713 * dispnew.c (syms_of_display):
11714 * doc.c (syms_of_doc):
11715 * editfns.c (syms_of_editfns):
11716 * emacs.c (syms_of_emacs):
11717 * eval.c (syms_of_eval):
11718 * fileio.c (syms_of_fileio):
11719 * fns.c (syms_of_fns):
11720 * frame.c (syms_of_frame):
11721 * fringe.c (syms_of_fringe):
11722 * insdel.c (syms_of_insdel):
11723 * keymap.c (syms_of_keymap):
11724 * lread.c (init_obarray, syms_of_lread):
11725 * macros.c (syms_of_macros):
11726 * msdos.c (syms_of_msdos):
11727 * print.c (syms_of_print):
11728 * process.c (syms_of_process):
11729 * search.c (syms_of_search):
11730 * sound.c (syms_of_sound):
11731 * syntax.c (init_syntax_once, syms_of_syntax):
11732 * terminal.c (syms_of_terminal):
11733 * textprop.c (syms_of_textprop):
11734 * undo.c (syms_of_undo):
11735 * w32.c (globals_of_w32):
11736 * window.c (syms_of_window):
11737 * xdisp.c (syms_of_xdisp):
11738 * xfaces.c (syms_of_xfaces):
11739 * xfns.c (syms_of_xfns):
11740 * xmenu.c (syms_of_xmenu):
11741 * xsettings.c (syms_of_xsettings):
11742 * xterm.c (syms_of_xterm): Use DEFSYM.
11744 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11746 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
11748 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11750 Integer and buffer overflow fixes (Bug#8873).
11752 * print.c (printchar, strout): Check for string overflow.
11753 (PRINTPREPARE, printchar, strout):
11754 Don't set size unless allocation succeeds.
11756 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11757 for sizes. Check for string overflow more accurately.
11758 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11760 * macros.c: Integer and buffer overflow fixes.
11761 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11762 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11763 Use ptrdiff_t, not int, for sizes.
11764 Don't increment bufsize until after realloc succeeds.
11765 Check for size-calculation overflow.
11766 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11768 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11770 * lread.c: Integer overflow fixes.
11771 (read_integer): Radix is now EMACS_INT, not int,
11772 to improve quality of diagnostics for out-of-range radices.
11773 Calculate buffer size correctly for out-of-range radices.
11774 (read1): Check for integer overflow in radices, and in
11775 read-circle numbers.
11776 (read_escape): Avoid int overflow.
11777 (Fload, openp, read_buffer_size, read1)
11778 (substitute_object_recurse, read_vector, read_list, map_obarray):
11779 Use ptrdiff_t, not int, for sizes.
11780 (read1): Use EMACS_INT, not int, for sizes.
11781 Check for size overflow.
11783 * image.c (cache_image): Check for size arithmetic overflow.
11785 * lread.c: Integer overflow issues.
11786 (saved_doc_string_size, saved_doc_string_length)
11787 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11788 Now ptrdiff_t, not int.
11789 (read1): Don't assume doc string length fits in int. Check for
11790 out-of-range doc string lengths.
11791 (read_list): Don't assume file position fits in int.
11792 (read_escape): Check for hex character overflow.
11794 2011-06-22 Leo Liu <sdl.web@gmail.com>
11796 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11797 Move to minibuffer.el.
11799 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11801 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
11802 The following patches are for when GLYPH_DEBUG && !XASSERT.
11803 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11804 * dispnew.c (flush_stdout):
11805 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11806 Mark as externally visible.
11807 * dispnew.c (check_window_matrix_pointers): Now static.
11808 * dispnew.c (window_to_frame_vpos):
11809 * xfns.c (unwind_create_frame):
11810 * xterm.c (x_check_font): Remove unused local.
11811 * scroll.c (CHECK_BOUNDS):
11812 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11813 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11814 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11815 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11816 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11818 (debug_method_add): Use va_list and vsprintf rather than relying
11819 on undefined behavior with wrong number of arguments.
11820 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11821 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11822 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11823 since we're not interested in debugging glyphs with old libraries.
11824 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11825 GCC 4.6.0's static checking.
11827 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11829 Integer overflow and signedness fixes (Bug#8873).
11830 A few related buffer overrun fixes, too.
11832 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11834 * dispextern.h (struct face.stipple):
11835 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11836 (x_bitmap_mask, x_allocate_bitmap_record)
11837 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11838 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11839 (x_create_bitmap_from_xpm_data):
11840 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11841 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11843 * xfaces.c (load_pixmap):
11844 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11845 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11846 (.bitmaps_last, struct x_output.icon_bitmap):
11847 Use ptrdiff_t, not int, for bitmap indexes.
11848 (x_allocate_bitmap_record): Check for size overflow.
11849 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11851 Use ptrdiff_t, not int, for overlay counts.
11852 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11853 * editfns.c (overlays_around, get_pos_property):
11854 * textprop.c (get_char_property_and_overlay):
11855 * xdisp.c (next_overlay_change, note_mouse_highlight):
11856 * xfaces.c (face_at_buffer_position):
11857 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11858 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11859 (Fnext_overlay_change, Fprevious_overlay_change)
11860 (mouse_face_overlay_overlaps, Foverlays_in):
11861 Use ptrdiff_t, not int, for sizes.
11862 (overlays_at, overlays_in): Check for size-calculation overflow.
11864 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11866 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11867 (x_session_initialize): Do not assume string length fits in int.
11869 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11870 This is unlikely, but can occur if DPI is outlandish.
11872 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
11873 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11875 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11876 * xrdb.c (magic_file_p, search_magic_path):
11877 Omit last arg SUFFIX; it was always 0. All callers changed.
11878 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11880 * xfont.c (xfont_match): Avoid need for strlen.
11882 * xfns.c: Don't assume strlen fits in int.
11883 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11885 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11886 not unsigned long, as we prefer signed integers. All callers changed.
11887 Detect integer overflow in repeat count.
11888 (message_dolog): Don't assume print length fits in 39 bytes.
11889 (display_mode_element): Don't assume strlen fits in int.
11891 * termcap.c: Don't assume sizes fit in int and never overflow.
11892 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11893 (gobble_line): Check for size-calculation overflow.
11895 * minibuf.c (Fread_buffer):
11896 * lread.c (intern, intern_c_string):
11897 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11898 Don't assume string length fits in int.
11900 * keyboard.c (parse_tool_bar_item):
11901 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11903 * font.c: Don't assume string length fits in int.
11904 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11905 Use ptrdiff_t, not int.
11906 (font_intern_prop): Don't assume string length fits in int.
11907 Don't assume integer property fits in fixnum.
11908 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
11910 * filelock.c: Fix some buffer overrun and integer overflow issues.
11911 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
11912 Reformulate so as not to need the command string.
11913 Invoke gzip -cd rather than gunzip, as it's more portable.
11914 (lock_info_type, lock_file_1, lock_file):
11915 Don't assume pid_t and time_t fit in unsigned long.
11916 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11917 (current_lock_owner): Prefer signed type for sizes.
11918 Use memcpy, not strncpy, where memcpy is what is really wanted.
11919 Don't assume (via atoi) that time_t and pid_t fit in int.
11920 Check for time_t and/or pid_t out of range, e.g., via a network share.
11921 Don't alloca where an auto var works fine.
11923 * fileio.c: Fix some integer overflow issues.
11924 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11925 Don't assume string length fits in int.
11926 (directory_file_name): Don't assume string length fits in long.
11927 (make_temp_name): Don't assume pid fits in int, or that its print
11928 length is less than 20.
11930 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11932 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11934 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11936 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11937 We prefer signed integers, even for size calculations.
11939 * emacs.c: Don't assume string length fits in 'int'.
11940 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11941 (main): Don't invoke strlen when not needed.
11943 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11944 (XD_DEBUG_MESSAGE): Don't waste a byte.
11946 * callproc.c (getenv_internal_1, getenv_internal)
11947 (Fgetenv_internal):
11948 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11950 * lread.c (invalid_syntax): Omit length argument.
11951 All uses changed. This doesn't fix a bug, but it simplifies the
11952 code away from its former Hollerith-constant appearance, and it's
11953 one less 'int' to worry about when looking at integer-overflow issues.
11954 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
11956 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11957 This didn't break anything, but it didn't help either.
11958 It's confusing to put a bogus integer in a place where the actual
11959 value does not matter.
11960 (LIST_END_P): Remove unused macro and its bogus comment.
11961 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
11963 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11964 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11966 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11967 We prefer signed types, and the value cannot exceed the EMACS_INT
11968 range anyway (because otherwise the length would not be representable).
11969 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11970 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11971 This avoids a GCC warning when WIDE_EMACS_INT.
11973 * indent.c (sane_tab_width): New function.
11974 (current_column, scan_for_column, Findent_to, position_indentation)
11975 (compute_motion): Use it. This is just for clarity.
11976 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
11978 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
11980 * lisp.h (lint_assume): New macro.
11981 * composite.c (composition_gstring_put_cache):
11982 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11984 * editfns.c, insdel.c:
11985 Omit unnecessary forward decls, to simplify future changes.
11987 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11989 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11991 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
11992 Use much-faster test for byte-length change.
11993 Don't assume string byte-length fits in 'int'.
11994 Check that character arg fits in 'int'.
11995 (mapcar1): Declare byte as byte, for clarity.
11997 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11999 * fns.c (concat): Catch string overflow earlier.
12000 Do not rely on integer wraparound.
12002 * dispextern.h (struct it.overlay_strings_charpos)
12003 (struct it.selective): Now EMACS_INT, not int.
12004 * xdisp.c (forward_to_next_line_start)
12005 (back_to_previous_visible_line_start)
12006 (reseat_at_next_visible_line_start, next_element_from_buffer):
12007 Don't arbitrarily truncate the value of 'selective' to int.
12009 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12011 * composite.c: Don't truncate sizes to 'int'.
12012 (composition_gstring_p, composition_reseat_it)
12013 (composition_adjust_point): Use EMACS_INT, not int.
12014 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12015 not EMACS_UINT, for indexes.
12017 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12019 * buffer.c: Include <verify.h>.
12020 (struct sortvec.priority, struct sortstr.priority):
12021 Now EMACS_INT, not int.
12022 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12023 (struct sortstr.size, record_overlay_string)
12024 (struct sortstrlist.size, struct sortlist.used):
12025 Don't truncate size to int.
12026 (record_overlay_string): Check for size-calculation overflow.
12027 (init_buffer_once): Check at compile-time, not run-time.
12029 2011-06-22 Jim Meyering <meyering@redhat.com>
12031 Don't leak an XBM-image-sized buffer
12032 * image.c (xbm_load): Free the image buffer after using it.
12034 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12037 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12038 that Sun C diagnosed.
12039 * fns.c (secure_hash): Fix pointer signedness issue.
12040 * intervals.c (static_offset_intervals): New function.
12041 (offset_intervals): Use it.
12043 2011-06-21 Leo Liu <sdl.web@gmail.com>
12046 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12049 * fns.c (secure_hash): Rename from crypto_hash_function and change
12050 the first arg to accept symbols.
12051 (Fsecure_hash): New primitive.
12052 (syms_of_fns): New symbols.
12054 2011-06-20 Deniz Dogan <deniz@dogan.se>
12056 * process.c (Fset_process_buffer): Clarify return value in
12059 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12061 * dispnew.c (add_window_display_history): Use BVAR.
12063 * xdisp.c (debug_method_add): Use BVAR.
12064 (check_window_end, dump_glyph_matrix, dump_glyph)
12065 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12067 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12070 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12071 check till after the cache is created in init_frame_faces.
12073 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12075 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12077 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12079 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12080 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12081 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12083 Improve buffer-overflow checking (Bug#8873).
12084 * fileio.c (Finsert_file_contents):
12085 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12086 Remove the old (too-loose) buffer overflow checks.
12087 They weren't needed, since make_gap checks for buffer overflow.
12088 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12089 The old code merely checked for Emacs fixnum overflow, and relied
12090 on undefined (wraparound) behavior. The new code avoids undefined
12091 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12093 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12094 Tune. Don't use wider integers than needed. Don't use alloca.
12095 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12097 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12099 * insdel.c, lisp.h (buffer_overflow): New function.
12100 (insert_from_buffer_1, replace_range, replace_range_2):
12101 * insdel.c (make_gap_larger):
12102 * editfns.c (Finsert_char):
12103 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12105 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12107 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12109 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12111 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12112 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12114 * fileio.c: Don't assume EMACS_INT fits in off_t.
12115 (emacs_lseek): New static function.
12116 (Finsert_file_contents, Fwrite_region): Use it.
12117 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12119 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12121 * fns.c: Don't overflow int when computing a list length.
12122 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12123 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12124 truncation on 64-bit hosts. Check for QUIT every
12125 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12126 faster and is responsive enough.
12127 (Flength): Report an error instead of overflowing an integer.
12128 (Fsafe_length): Return a float if the value is not representable
12129 as a fixnum. This shouldn't happen except in contrived situations.
12130 (Fnthcdr, Fsort): Don't assume list length fits in int.
12131 (Fcopy_sequence): Don't assume vector length fits in int.
12133 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12134 (header_size, word_size): New constants.
12135 (allocate_vectorlike): Don't check size overflow here.
12136 (allocate_vector): Check it here instead, since this is the only
12137 caller of allocate_vectorlike that could cause overflow.
12138 Check that the new vector's length is representable as a fixnum.
12140 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12141 The previous code was bogus. For example, next_almost_prime (32)
12142 returned 39, which is undesirable as it is a multiple of 3; and
12143 next_almost_prime (24) returned 25, which is a multiple of 5 so
12144 why was the code bothering to check for multiples of 7?
12146 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12148 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12150 Variadic C functions now count arguments with ptrdiff_t.
12151 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12152 Back then I didn't know that the Emacs coding style prefers signed int.
12153 Also, in the meantime I found a few more instances where arguments
12154 were being counted with int, which may truncate counts on 64-bit
12155 machines, or EMACS_INT, which may be unnecessarily wide.
12156 * lisp.h (struct Lisp_Subr.function.aMANY)
12157 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12158 Arg counts are now ptrdiff_t, not size_t.
12159 All variadic functions and their callers changed accordingly.
12160 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12161 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12162 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12163 * callint.c (Fcall_interactively): Check arg count for overflow,
12164 to avoid potential buffer overrun. Use signed char, not 'int',
12165 for 'varies' array, so that we needn't bother to check its size
12166 calculation for overflow.
12167 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12168 * eval.c (apply_lambda):
12169 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12170 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12171 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12173 * callint.c (Fcall_interactively): Don't use index var as event count.
12175 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12176 * mem-limits.h (SIZE): Remove; no longer used.
12178 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12180 Remove unnecessary casts.
12181 * xterm.c (x_term_init):
12182 * xfns.c (x_set_border_pixel):
12183 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12184 These aren't needed now that we assume ANSI C.
12186 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12187 It's more likely to cause problems (due to unsigned overflow)
12190 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12192 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12194 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12196 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12198 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12200 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12202 GLYPH_CODE_FACE returns EMACS_INT, not int.
12203 * dispextern.h (merge_faces):
12204 * xfaces.c (merge_faces):
12205 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12206 Don't assume EMACS_INT fits in int.
12208 * character.h (CHAR_VALID_P): Remove unused parameter.
12209 * fontset.c, lisp.h, xdisp.c: All uses changed.
12211 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12213 * fns.c (concat): Minor tuning based on overflow analysis.
12214 This doesn't fix any bugs. Use int to hold character, instead
12215 of constantly refetching from Emacs object. Use XFASTINT, not
12216 XINT, for value known to be a character. Don't bother comparing
12217 a single byte to 0400, as it's always less.
12219 * floatfns.c (Fexpt):
12220 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12222 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12225 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12227 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12228 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12229 incorrectly succeed when S was a string, because 4294967386 was
12230 truncated before it was used.
12232 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12233 Otherwise, an out-of-range integer could cause undefined behavior
12236 * composite.c: Use int, not EMACS_INT, for characters.
12237 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12238 EMACS_INT, for values that are known to be in character range.
12239 This doesn't fix any bugs but is the usual style inside Emacs and
12240 may generate better code on 32-bit machines.
12242 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12243 This is for reasons similar to the recent CHAR_STRING fix.
12244 * charset.c (Fencode_char): Check that character arg is actually
12245 a character. Pass an int to ENCODE_CHAR.
12246 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12247 wider than 'int', as a compile-time check to prevent future regressions
12250 * character.c (char_string): Remove unnecessary casts.
12252 Make sure a 64-bit char is never passed to CHAR_STRING.
12253 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12254 by silently ignoring the top 32 bits, allowing some values
12255 that were far too large to be valid characters.
12256 * character.h: Include <verify.h>.
12257 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12258 arguments are no wider than unsigned, as a compile-time check
12259 to prevent future regressions in this area.
12261 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12262 (Fsubst_char_in_region):
12264 * xdisp.c (decode_mode_spec_coding):
12265 Adjust to CHAR_STRING's new requirement.
12266 * editfns.c (Finsert_char, Fsubst_char_in_region):
12267 * fns.c (concat): Check that character args are actually
12268 characters. Without this test, these functions did the wrong
12269 thing with wildly out-of-range values on 64-bit hosts.
12271 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12272 These casts should not be needed on 32-bit hosts, either.
12273 * keyboard.c (read_char):
12274 * lread.c (Fload): Remove casts to unsigned.
12276 * lisp.h (UNSIGNED_CMP): New macro.
12277 This fixes comparison bugs on 64-bit hosts.
12278 (ASCII_CHAR_P): Use it.
12279 * casefiddle.c (casify_object):
12280 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
12281 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12282 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12283 * dispextern.h (FACE_FROM_ID):
12284 * keyboard.c (read_char): Use UNSIGNED_CMP.
12286 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12287 not to EMACS_INT, to avoid GCC warning.
12289 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12291 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12292 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12293 isn't needed on 32-bit machines.
12295 * buffer.c (Fgenerate_new_buffer_name):
12296 Use EMACS_INT for count, not int.
12297 (advance_to_char_boundary): Return EMACS_INT, not int.
12299 * data.c (Qcompiled_function): Now static.
12301 * window.c (window_body_lines): Now static.
12303 * image.c (gif_load): Rename local to avoid shadowing.
12305 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12306 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12307 * alloc.c (make_save_value): Integer argument is now of type
12308 ptrdiff_t, not int.
12309 (mark_object): Use ptrdiff_t, not int.
12310 * lisp.h (pD): New macro.
12311 * print.c (print_object): Use it.
12313 * alloc.c: Use EMACS_INT, not int, to count objects.
12314 (total_conses, total_markers, total_symbols, total_vector_size)
12315 (total_free_conses, total_free_markers, total_free_symbols)
12316 (total_free_floats, total_floats, total_free_intervals)
12317 (total_intervals, total_strings, total_free_strings):
12318 Now EMACS_INT, not int. All uses changed.
12319 (Fgarbage_collect): Compute overall total using a double, so that
12320 integer overflow is less likely to be a problem. Check for overflow
12321 when converting back to an integer.
12322 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12323 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12324 These were 'int' variables that could overflow on 64-bit hosts;
12325 they were never used, so remove them instead of repairing them.
12326 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
12327 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12328 Previously, this ceilinged at INT_MAX, but that doesn't work on
12330 (allocate_pseudovector): Don't use EMACS_INT when int would do.
12332 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
12333 (allocate_vectorlike): Check for ptrdiff_t overflow.
12334 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12335 when a (possibly-narrower) signed value would do just as well.
12336 We prefer using signed arithmetic, to avoid comparison confusion.
12338 * alloc.c: Catch some string size overflows that we were missing.
12339 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12340 for convenience in STRING_BYTES_MAX.
12341 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12342 The definition here is exact; the one in lisp.h was approximate.
12343 (allocate_string_data): Check for string overflow. This catches
12344 some instances we weren't catching before. Also, it catches
12345 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12346 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12347 and ptrdiff_t and EMACS_INT are both 64 bits.
12349 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12350 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
12351 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
12353 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12355 * alloc.c (Fmake_string): Check for out-of-range init.
12357 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12359 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12361 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12363 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12364 xg_get_default_scrollbar_width.
12366 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12367 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12368 (style_changed_cb): Call update_theme_scrollbar_width and call
12369 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12370 all frames (Bug#8505).
12371 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12372 Call gtk_window_set_resizable if HAVE_GTK3.
12373 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12374 and height if HAVE_GTK3 (Bug#8505).
12375 (scroll_bar_width_for_theme): New variable.
12376 (update_theme_scrollbar_width): New function.
12377 (xg_get_default_scrollbar_width): Move code to
12378 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12379 (xg_initialize): Call update_theme_scrollbar_width.
12381 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12383 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12385 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12387 * frame.c (make_frame): Call other_buffer_safely instead of
12390 * window.c (temp_output_buffer_show): Call display_buffer with
12391 second argument Vtemp_buffer_show_specifiers and reset latter
12392 immediately after the call.
12393 (Vtemp_buffer_show_specifiers): New variable.
12394 (auto_window_vscroll_p, next_screen_context_lines)
12395 (Vscroll_preserve_screen_position): Remove leading asterisks from
12398 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
12400 Fix minor problems found by GCC 4.6.0 static checking.
12401 * buffer.c (Qclone_number): Remove for now, as it's unused.
12402 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12403 (record_buffer): Remove unused local.
12404 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12405 (set_frame_buffer_list): Remove; unused.
12406 * frame.h (other_visible_frames): Remove decl.
12407 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12408 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12409 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12411 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12412 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12413 Define only if HAVE_GPM.
12414 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12415 (update_hints_inhibit): Remove; never set. All uses removed.
12416 * widgetprv.h (emacsFrameClassRec): Remove decl.
12417 * window.c (delete_deletable_window): Now returns void, since it
12418 wasn't returning anything.
12419 (compare_window_configurations): Remove unused locals.
12420 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12421 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
12422 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12423 the same widths as pointers. This follows up on the 2011-05-06 patch.
12424 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12425 * xterm.h: Likewise.
12426 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12428 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
12430 * makefile.w32-in: Update dependencies.
12431 (LISP_H): Add lib/intprops.h.
12433 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12435 * image.c (gif_load): Add animation frame delay to the metadata.
12436 (syms_of_image): Use DEFSYM. New symbol `delay'.
12438 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12440 * window.c (delete_deletable_window): Re-add.
12441 (Fset_window_configuration): Rewrite to handle dead buffers and
12442 consequently deletable windows.
12443 (window_tree, Fwindow_tree): Remove. Supply functionality in
12445 (compare_window_configurations): Simplify code.
12447 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12449 * image.c (imagemagick_load_image): Fix type mismatch.
12450 (Fimagemagick_types): Likewise.
12452 * window.h (replace_buffer_in_windows): Declare.
12454 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12456 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12457 Qclone_number. Remove external declaration of Qdelete_window.
12458 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12460 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12461 Run Qbuffer_list_update_hook if allowed.
12462 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12463 buffer list implementation.
12464 (other_buffer_safely): New function.
12465 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12466 calls to replace_buffer_in_windows and
12467 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12469 (record_buffer): Inhibit quitting and rewrite using quittable
12470 functions. Run Qbuffer_list_update_hook if allowed.
12471 (Frecord_buffer, Funrecord_buffer): New functions.
12472 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12473 Move switch-to-buffer to window.el.
12474 (bury-buffer): Move to window.el.
12475 (Vbuffer_list_update_hook): New variable.
12477 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12480 * window.h (resize_frame_windows): Move up in code.
12481 (Fwindow_frame): Remove EXFUN.
12482 (replace_buffer_in_all_windows): Remove prototype.
12483 (replace_buffer_in_windows_safely): Add prototype.
12485 * window.c: Declare Qdelete_window static again. Move down
12486 declaration of select_count.
12487 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12488 (Fother_window): Move to window.el.
12489 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12490 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12491 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12493 (replace_buffer_in_windows): Implement by calling
12494 Qreplace_buffer_in_windows.
12495 (replace_buffer_in_all_windows): Remove with some functionality
12496 moved into replace_buffer_in_windows_safely.
12497 (replace_buffer_in_windows_safely): New function.
12498 (select_window_norecord, select_frame_norecord): Move in front
12499 of run_window_configuration_change_hook. Remove now obsolete
12501 (Fset_window_buffer): Rewrite doc-string.
12502 Call Qrecord_window_buffer.
12503 (keys_of_window): Move binding for other-window to window.el.
12505 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12507 * dispextern.h (struct image): Replace data member, whose int_val
12508 and ptr_val fields were not used by anything, with a single
12511 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12512 (gif_clear_image, gif_load, imagemagick_load_image)
12513 (gs_clear_image, gs_load): Callers changed.
12515 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12517 * buffer.h: Include <time.h>, for time_t.
12518 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12520 Fix minor problems found by static checking.
12522 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12524 Make identifiers static if they are not used in other modules.
12525 * data.c (Qcompiled_function, Qframe, Qvector):
12526 * image.c (QimageMagick, Qsvg):
12527 * minibuf.c (Qmetadata):
12528 * window.c (resize_window_check, resize_root_window): Now static.
12529 * window.h (resize_window_check, resize_root_window): Remove decls.
12531 * window.c (window_deletion_count, delete_deletable_window):
12533 (window_body_lines): Now static.
12534 (Fdelete_other_windows_internal): Mark vars as initialized.
12535 Make sure 'resize_failed' is initialized.
12536 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12537 (resize_window_apply): Remove unused local.
12538 * window.h (delete_deletable_window): Remove decl.
12540 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
12541 (imagemagick_load_image): Fix pointer signedness problem by changing
12542 last arg from unsigned char * to char *. All uses changed.
12543 Also, fix a local for similar reasons.
12544 Remove unused locals. Remove locals to avoid shadowing.
12545 (fn_rsvg_handle_free): Remove; unused.
12546 (svg_load, svg_load_image): Fix pointer signedness problem.
12547 (imagemagick_load_image): Don't use garbage pointer image_wand.
12549 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12551 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
12553 * image.c (gif_load): Fix omitted cast error introduced by
12556 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12558 * window.h (resize_proportionally, orig_total_lines)
12559 (orig_top_line): Remove from window structure.
12560 (set_window_height, set_window_width, change_window_heights)
12561 (Fdelete_window): Remove prototypes.
12562 (resize_frame_windows): Remove duplicate declaration.
12564 2011-06-10 Eli Zaretskii <eliz@gnu.org>
12566 * window.h (resize_frame_windows, resize_window_check)
12567 (delete_deletable_window, resize_root_window)
12568 (resize_frame_windows): Declare prototypes.
12570 * window.c (resize_window_apply): Make definition be "static" to
12571 match the prototype.
12573 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12575 * window.c: Remove declarations of Qwindow_size_fixed,
12576 window_min_size_1, window_min_size_2, window_min_size,
12577 size_window, window_fixed_size_p, enlarge_window, delete_window.
12578 Remove static from declaration of Qdelete_window, it's
12579 temporarily needed by Fbury_buffer.
12580 (replace_window): Don't assign orig_top_line and
12582 (Fdelete_window, delete_window): Remove. Window deletion is
12583 handled by window.el.
12584 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12585 Replace Fdelete_window calls with calls to Qdelete_window.
12586 (Fdelete_other_windows): Remove. Deleting other windows is
12587 handled by window.el.
12588 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12589 handled in window.el.
12590 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12591 Window minimum sizes are handled in window.el.
12592 (shrink_windows, size_window, set_window_height)
12593 (set_window_width, change_window_heights, window_height)
12594 (window_width, CURBEG, CURSIZE, enlarge_window)
12595 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12596 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12597 handled in window.el.
12598 (make_dummy_parent): Rename to make_parent_window and give it a
12599 second argument horflag.
12600 (make_window): Don't set resize_proportionally any more.
12601 (Fsplit_window): Remove. Windows are split in window.el.
12602 (save_restore_action, save_restore_orig_size)
12603 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12604 Resize mini windows in window.el.
12605 (grow_mini_window, shrink_mini_window): Implement by calling
12606 Qresize_root_window_vertically, resize_window_check and
12607 resize_window_apply.
12608 (saved_window, Fset_window_configuration, save_window_save):
12609 Do not handle orig_top_line, orig_total_lines, and
12610 resize_proportionally.
12611 (window_min_height, window_min_width): Move to window.el.
12612 (keys_of_window): Move bindings for delete-other-windows,
12613 split-window, delete-window and enlarge-window to window.el.
12615 * buffer.c: Temporarily extern Qdelete_window.
12616 (Fbury_buffer): Temporarily call Qdelete_window instead of
12617 Fdelete_window (Fbury_buffer will move to window.el soon).
12619 * frame.c (set_menu_bar_lines_1): Remove code handling
12620 orig_top_line and orig_total_lines.
12622 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12623 set_window_height but set heights directly.
12624 (change_frame_size_1): Use resize_frame_windows.
12626 * xdisp.c (init_xdisp): Don't use set_window_height but set
12629 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12630 Use resize_frame_windows instead of change_window_heights and run
12631 run_window_configuration_change_hook.
12633 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12634 instead of change_window_heights and run
12635 run_window_configuration_change_hook.
12637 2011-06-09 Martin Rudalics <rudalics@gmx.at>
12639 * window.c (replace_window): Rename second argument REPLACEMENT to
12640 NEW. New third argument SETFLAG. Rewrite.
12641 (delete_window, make_dummy_parent): Call replace_window with
12643 (window_list_1): Move down in code.
12644 (run_window_configuration_change_hook): Move set_buffer part
12645 before select_frame_norecord part in order to unwind correctly.
12646 Rename count1 to count.
12647 (recombine_windows, delete_deletable_window, resize_root_window)
12648 (Fdelete_other_windows_internal)
12649 (Frun_window_configuration_change_hook, make_parent_window)
12650 (resize_window_check, resize_window_apply, Fresize_window_apply)
12651 (resize_frame_windows, Fsplit_window_internal)
12652 (Fdelete_window_internal, Fresize_mini_window_internal):
12654 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12656 2011-06-08 Martin Rudalics <rudalics@gmx.at>
12658 * window.h (window): Add some new members to window structure -
12659 normal_lines, normal_cols, new_total, new_normal, clone_number,
12660 splits, nest, prev_buffers, next_buffers.
12661 (WINDOW_TOTAL_SIZE): Move here from window.c.
12662 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
12664 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12666 (make_dummy_parent): Set new members of windows structure.
12667 (make_window): Move down in code. Handle new members of window
12669 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12670 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12671 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12672 (Fset_window_prev_buffers, Fwindow_next_buffers)
12673 (Fset_window_next_buffers, Fset_window_clone_number):
12675 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12676 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12678 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12679 Argument WINDOW can be now internal window too.
12680 (Fwindow_use_time): Move up in code.
12681 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12682 Rewrite doc-string.
12683 (Fset_window_configuration, saved_window)
12684 (Fcurrent_window_configuration, save_window_save): Handle new
12685 members of window structure.
12686 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12687 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12688 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12689 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12690 Qget_mru_window, Qresize_root_window,
12691 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12692 Qauto_buffer_name; staticpro them.
12694 2011-06-07 Martin Rudalics <rudalics@gmx.at>
12696 * window.c (Fwindow_total_size, Fwindow_left_column)
12697 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12698 (Fwindow_list_1): New functions.
12699 (window_box_text_cols): Replace with window_body_cols.
12700 (Fwindow_width, Fscroll_left, Fscroll_right):
12701 Use window_body_cols instead of window_box_text_cols.
12702 (delete_window, Fset_window_configuration):
12703 Call delete_all_subwindows with window as argument.
12704 (delete_all_subwindows): Take a window as argument and not a
12705 structure. Rewrite.
12706 (window_loop): Remove handling of GET_LRU_WINDOW and
12707 GET_LARGEST_WINDOW.
12708 (Fget_lru_window, Fget_largest_window): Move to window.el.
12710 * window.h: Extern window_body_cols instead of
12711 window_box_text_cols. delete_all_subwindows now takes a
12712 Lisp_Object as argument.
12714 * indent.c (compute_motion, Fcompute_motion):
12715 Use window_body_cols instead of window_box_text_cols.
12717 * frame.c (delete_frame): Call delete_all_subwindows with root
12718 window as argument.
12720 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12722 * fns.c (Fputhash): Document return value.
12724 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
12726 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12728 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12730 Cons<->int and similar integer overflow fixes (Bug#8794).
12732 Check for overflow when converting integer to cons and back.
12733 * charset.c (Fdefine_charset_internal, Fdecode_char):
12734 Use cons_to_unsigned to catch overflow.
12735 (Fencode_char): Use INTEGER_TO_CONS.
12736 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12737 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12738 * data.c (long_to_cons, cons_to_long): Remove.
12739 (cons_to_unsigned, cons_to_signed): New functions.
12740 These signal an error for invalid or out-of-range values.
12741 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12742 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12743 * font.c (Ffont_variation_glyphs):
12744 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12745 * lisp.h: Include <intprops.h>.
12746 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12747 (cons_to_signed, cons_to_unsigned): New decls.
12748 (long_to_cons, cons_to_long): Remove decls.
12749 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12750 (Fprimitive_undo): Use CONS_TO_INTEGER.
12751 * xfns.c (Fx_window_property): Likewise.
12752 * xselect.c: Include <limits.h>.
12753 (x_own_selection, selection_data_to_lisp_data):
12754 Use INTEGER_TO_CONS.
12755 (x_handle_selection_request, x_handle_selection_clear)
12756 (x_get_foreign_selection, Fx_disown_selection_internal)
12757 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12758 (lisp_data_to_selection_data): Use cons_to_unsigned.
12759 (x_fill_property_data): Use cons_to_signed.
12760 Report values out of range.
12762 Check for buffer and string overflow more precisely.
12763 * buffer.h (BUF_BYTES_MAX): New macro.
12764 * lisp.h (STRING_BYTES_MAX): New macro.
12765 * alloc.c (Fmake_string):
12766 * character.c (string_escape_byte8):
12767 * coding.c (coding_alloc_by_realloc):
12768 * doprnt.c (doprnt):
12769 * editfns.c (Fformat):
12771 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12772 since they may not be the same number.
12773 * editfns.c (Finsert_char):
12774 * fileio.c (Finsert_file_contents):
12775 Likewise for BUF_BYTES_MAX.
12777 * image.c: Use ptrdiff_t, not int, for sizes.
12778 (slurp_file): Switch from int to ptrdiff_t.
12780 (slurp_file): Check that file size fits in both size_t (for
12781 malloc) and ptrdiff_t (for sanity and safety).
12783 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12784 if b->modtime has its maximal value.
12786 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12788 Don't assume time_t can fit into int.
12789 * buffer.h (struct buffer.modtime): Now time_t, not int.
12790 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12791 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12793 Minor fixes for signed vs unsigned integers.
12794 * character.h (MAYBE_UNIFY_CHAR):
12795 * charset.c (maybe_unify_char):
12796 * keyboard.c (read_char, reorder_modifiers):
12797 XINT -> XFASTINT, since the integer must be nonnegative.
12798 * ftfont.c (ftfont_spec_pattern):
12799 * keymap.c (access_keymap, silly_event_symbol_error):
12800 XUINT -> XFASTINT, since the integer must be nonnegative.
12801 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12802 since it makes no difference and we prefer signed.
12803 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12804 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12807 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12809 * window.h (Fwindow_frame): Declare.
12811 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12813 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12814 (SPARE_MEMORY): Always define.
12815 (LARGE_REQUEST): Remove.
12816 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12818 2011-06-06 Martin Rudalics <rudalics@gmx.at>
12820 * lisp.h: Move EXFUNS for Fframe_root_window,
12821 Fframe_first_window and Fset_frame_selected_window to window.h.
12823 * window.h: Move EXFUNS for Fframe_root_window,
12824 Fframe_first_window and Fset_frame_selected_window here from
12827 * frame.c (Fwindow_frame, Fframe_first_window)
12828 (Fframe_root_window, Fframe_selected_window)
12829 (Fset_frame_selected_window): Move to window.c.
12830 (Factive_minibuffer_window): Move to minibuf.c.
12831 (Fother_visible_frames_p): New function.
12833 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12835 * window.c (decode_window, decode_any_window): Move up in code.
12836 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12837 (inhibit_frame_unsplittable): Remove unused variable.
12838 (Fwindow_buffer): Move up and rewrite doc-string.
12839 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12840 (Fwindow_prev): New functions.
12841 (Fwindow_frame): Move here from frame.c. Accept any window as
12843 (Fframe_root_window, Fframe_first_window)
12844 (Fframe_selected_window): Move here from frame.c. Accept frame
12845 or arbitrary window as argument. Update doc-strings.
12846 (Fminibuffer_window): Move up in code.
12847 (Fwindow_minibuffer_p): Move up in code and simplify.
12848 (Fset_frame_selected_window): Move here from frame.c.
12850 (Fselected_window, select_window, Fselect_window): Move up in
12851 code. Minor doc-string fixes.
12853 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12855 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12856 Do not assume that spare memory exists; that assumption is valid
12857 only if SYSTEM_MALLOC.
12858 (LARGE_REQUEST): New macro, so that the issue of large requests
12859 is separated from the issue of spare memory.
12861 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12863 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12866 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12868 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12871 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12873 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12875 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12877 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12878 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12880 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
12882 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12884 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
12886 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12887 (x_clipboard_manager_save): Add return value.
12888 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12889 New error handlers.
12890 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12891 Obey Vx_select_enable_clipboard_manager. Catch errors in
12892 x_clipboard_manager_save (Bug#8779).
12893 (Vx_select_enable_clipboard_manager): New variable.
12894 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
12896 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
12898 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12900 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12902 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12903 in the current matrix if keep_current_p is non-zero.
12905 2011-06-04 Eli Zaretskii <eliz@gnu.org>
12907 * bidi.c (bidi_level_of_next_char): Fix last change.
12909 2011-06-03 Eli Zaretskii <eliz@gnu.org>
12911 Support bidi reordering of text covered by display properties.
12913 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12914 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12915 (bidi_cache_search, bidi_cache_iterator_state)
12916 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12917 (bidi_level_of_next_char, bidi_move_to_visually_next):
12918 Support character positions inside a run of characters covered by a
12920 (bidi_paragraph_init, bidi_resolve_explicit_1)
12921 (bidi_level_of_next_char): Call bidi_fetch_char and
12922 bidi_fetch_char_advance instead of FETCH_CHAR and
12923 FETCH_CHAR_ADVANCE.
12924 (bidi_init_it): Initialize new members.
12925 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12927 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12928 instead of using explicit *_CHAR codes.
12929 (bidi_resolve_explicit, bidi_resolve_weak):
12930 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
12931 bidirectional text is supported only in multibyte buffers.
12932 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12933 it to initialize the frame_window_p member of struct bidi_it.
12934 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12935 (bidi_resolve_explicit, bidi_resolve_weak)
12936 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12937 bidi_it->nchars is non-positive.
12938 (bidi_level_of_next_char): Don't try to lookup the cache for the
12939 next/previous character if nothing is cached there yet, or if we
12940 were just reseat()'ed to a new position.
12942 * xdisp.c (set_cursor_from_row): Set start and stop points
12943 according to the row's direction when priming the loop that looks
12944 for the glyph on which to display cursor.
12945 (single_display_spec_intangible_p): Function deleted.
12946 (display_prop_intangible_p): Reimplement to call
12947 handle_display_spec instead of single_display_spec_intangible_p.
12948 Accept 3 additional arguments needed by handle_display_spec.
12949 This fixes incorrect cursor motion across display property with complex
12950 values: lists, `(when COND...)' forms, etc.
12951 (single_display_spec_string_p): Support property values that are
12952 lists with the argument STRING its top-level element.
12953 (display_prop_string_p): Fix the condition for processing a
12954 property that is a list to be consistent with handle_display_spec.
12955 (handle_display_spec): New function, refactored from the
12956 last portion of handle_display_prop.
12957 (compute_display_string_pos): Accept additional argument
12958 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12959 value of a `display' property is a "replacing spec".
12960 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12961 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12962 the display property, but just return a value indicating whether
12963 the display property will replace the characters it covers.
12964 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12965 frame_window_p members of struct bidi_it.
12966 (compute_display_string_pos, compute_display_string_end):
12968 (push_it): Accept second argument POSITION, where pop_it should
12969 jump to continue iteration.
12970 (reseat_1): Initialize bidi_it.disp_pos.
12972 * keyboard.c (adjust_point_for_property): Adjust the call to
12973 display_prop_intangible_p to its new signature.
12975 * dispextern.h (struct bidi_it): New member frame_window_p.
12976 (bidi_init_it): Update prototypes.
12977 (display_prop_intangible_p): Update prototype.
12978 (compute_display_string_pos, compute_display_string_end):
12979 Declare prototypes.
12980 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12983 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
12985 Malloc failure behavior now depends on size of allocation.
12986 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12987 * lisp.h: Change signatures accordingly.
12988 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12989 All callers changed. (Bug#8762)
12991 * gnutls.c: Use Emacs's memory allocators.
12992 Without this change, the gnutls library would invoke malloc etc.
12993 directly, which causes problems on non-SYNC_INPUT hosts, and which
12994 runs afoul of improving memory_full behavior. (Bug#8761)
12995 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12996 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12997 xfree instead of the default malloc, realloc, free.
12998 (Fgnutls_boot): No need to check for memory allocation failure,
12999 since xmalloc does that for us.
13001 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13002 * category.c (hash_get_category_set):
13003 * ccl.c (ccl_driver):
13004 * charset.c (Fdefine_charset_internal):
13005 * charset.h (struct charset.hash_index):
13006 * composite.c (get_composition_id, gstring_lookup_cache)
13007 (composition_gstring_put_cache):
13008 * composite.h (struct composition.hash_index):
13009 * dispextern.h (struct image.hash):
13010 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13011 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13012 (hashfn_equal, hashfn_user_defined, make_hash_table)
13013 (maybe_resize_hash_table, hash_lookup, hash_put)
13014 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13015 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13016 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13017 * image.c (make_image, search_image_cache, lookup_image)
13018 (xpm_put_color_table_h):
13019 * lisp.h (struct Lisp_Hash_Table):
13020 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13021 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13022 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13023 * alloc.c (allocate_vectorlike):
13024 Check for overflow in vector size calculations.
13025 * ccl.c (ccl_driver):
13026 Check for overflow when converting EMACS_INT to int.
13027 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13028 need to be updated by these changes.
13029 * fns.c (make_hash_table, maybe_resize_hash_table):
13030 Check for integer overflow with large hash tables.
13031 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13032 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13033 (SXHASH_REDUCE): New macro.
13034 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13035 Use it instead of discarding useful hash info with large hash values.
13036 (sxhash_float): New function.
13037 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13038 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13039 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13040 Rewrite to use FIXNUM_BITS, as this simplifies things.
13041 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13042 Adjust signatures to match updated version of code.
13043 (consing_since_gc): Now EMACS_INT, since a single hash table can
13044 use more than INT_MAX bytes.
13046 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13048 Make it possible to build with GCC-4.6+ -O2 -flto.
13050 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13052 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13054 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13055 Call minibuffer-inactive-mode.
13057 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13059 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13060 Update dependencies.
13062 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13064 * data.c (init_data): Remove code for UTS, this system is not
13067 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13069 Don't force ./temacs to start in terminal mode.
13071 * frame.c (make_initial_frame): Initialize faces in all cases, not
13072 only when CANNOT_DUMP is defined.
13073 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13075 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13077 * dispnew.c (add_window_display_history): Use const for the string
13078 pointer. Remove declaration, not needed.
13080 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13082 Use 'inline', not 'INLINE'.
13083 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13084 * alloc.c, fontset.c (INLINE): Remove.
13085 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13086 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13087 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13088 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13089 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13091 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13093 Make it possible to run ./temacs.
13095 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13096 syms_of_callproc does the same thing. Remove test for
13097 "initialized", do it in the caller.
13098 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13100 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13102 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13103 (read_minibuf): Use get_minibuffer.
13104 (syms_of_minibuf): Use DEFSYM.
13105 (Qmetadata): New var.
13106 * data.c (Qbuffer): Don't make it static.
13107 (syms_of_data): Use DEFSYM.
13109 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13111 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13112 (CCL_CODE_MIN): New macro.
13114 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13116 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13118 * eval.c (Qdebug): Now static.
13119 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13120 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13121 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13123 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13125 * image.c: Various fixes to ImageMagick code comments.
13126 (Fimagemagick_types): Doc fix.
13128 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13130 Minor fixes prompted by GCC 4.6.0 warnings.
13132 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13134 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13135 (x_clipboard_manager_save_all): Move extern decl to ...
13136 * xterm.h: ... here, so that it can be checked for consistency.
13138 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13140 * xselect.c (x_clipboard_manager_save_frame)
13141 (x_clipboard_manager_save_all): New functions.
13142 (Fx_clipboard_manager_save): Lisp function deleted.
13144 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13145 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13147 * xterm.h: Update prototype.
13149 2011-05-28 William Xu <william.xwl@gmail.com>
13151 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13152 exiting (Bug#8239).
13154 2011-05-28 Jim Meyering <meyering@redhat.com>
13156 Avoid a sign-extension bug in crypto_hash_function.
13157 * fns.c (to_uchar): Define.
13158 (crypto_hash_function): Use it to convert some newly-signed
13159 variables to unsigned, to avoid sign-extension bugs. For example,
13160 without this change, (md5 "truc") would evaluate to
13161 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13162 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13163 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13165 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13167 Integer overflow fixes.
13169 * dbusbind.c: Serial number integer overflow fixes.
13170 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13171 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13172 to hold a serial number that is too large for a fixnum.
13173 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13174 Check for serial numbers out of range. Decode any serial number
13175 that was so large that it became a float. (Bug#8722)
13177 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13178 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13179 Use XFASTINT rather than XUINT when numbers are nonnegative.
13180 (xd_append_arg, Fdbus_method_return_internal):
13181 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13182 arguments, check that Lisp number is nonnegative, rather than
13183 silently wrapping negative numbers around. (Bug#8722)
13184 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13187 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13189 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13191 ccl: Add integer overflow checks.
13192 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13193 (IN_INT_RANGE): New macros.
13194 (ccl_driver): Use them to check for integer overflow when
13195 decoding a CCL program. Many of the new checks are whether XINT (x)
13196 fits in int; it doesn't always, on 64-bit hosts. The new version
13197 doesn't catch all possible integer overflows, but it's an
13198 improvement. (Bug#8719)
13200 * alloc.c (make_event_array): Use XINT, not XUINT.
13201 There's no need for unsigned here.
13203 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13204 This follows up to the 2011-05-06 change that substituted uintptr_t
13205 for EMACS_INT. This case wasn't caught back then.
13207 Rework Fformat to avoid integer overflow issues.
13208 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13209 now (part of C89). Include <verify.h>.
13210 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13211 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13212 (Fformat): Avoid the prepass trying to compute sizes; it was only
13213 approximate and thus did not catch overflow reliably. Instead, walk
13214 through the format just once, formatting and computing sizes as we go,
13215 checking for integer overflow at every step, and allocating a larger
13216 buffer as needed. Keep track separately whether the format is
13217 multibyte. Keep only the most-recently calculated precision, rather
13218 than them all. Record whether each argument has been converted to
13219 string. Use EMACS_INT, not int, for byte and char and arg counts.
13220 Support field widths and precisions larger than INT_MAX. Avoid
13221 sprintf's undefined behavior with conversion specifications such as %#d
13222 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13223 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13224 formatting out-of-range floating point numbers with int
13225 formats. (Bug#8668)
13227 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13229 * data.c: Avoid integer truncation in expressions involving floats.
13230 * data.c: Include <intprops.h>.
13231 (arith_driver): When there's an integer overflow in an expression
13232 involving floating point, convert the integers to floating point
13233 so that the resulting value does not suffer from catastrophic
13234 integer truncation. For example, on a 64-bit host (* 4
13235 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13236 Do not rely on undefined behavior after integer overflow.
13238 merge count_size_as_multibyte, parse_str_to_multibyte
13239 * character.c, character.h (count_size_as_multibyte):
13240 Rename from parse_str_to_multibyte; all uses changed.
13241 Check for integer overflow.
13242 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13243 since it's now a duplicate of the other. This is more of
13244 a character than a buffer op, so better that it's in character.c.
13245 * fns.c, print.c: Adjust to above changes.
13247 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13249 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13251 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13253 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13254 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13255 (x_clipboard_manager_save): Now static.
13256 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13258 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13259 (crypto_hash_function): Now static.
13260 Fix pointer signedness problems. Avoid unnecessary initializations.
13262 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13264 * termhooks.h (Vselection_alist): Make it terminal-local.
13266 * terminal.c (create_terminal): Initialize it.
13268 * xselect.c: Support for clipboard managers.
13269 (Vselection_alist): Move to termhooks.h as terminal-local var.
13270 (LOCAL_SELECTION): New macro.
13271 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13272 (symbol_to_x_atom): Remove gratuitous arg.
13273 (x_handle_selection_request, lisp_data_to_selection_data)
13274 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13275 (x_own_selection, x_get_local_selection, x_convert_selection):
13276 New arg, specifying work frame. Use terminal-local Vselection_alist.
13277 (some_frame_on_display): Delete unused function.
13278 (Fx_own_selection_internal, Fx_get_selection_internal)
13279 (Fx_disown_selection_internal, Fx_selection_owner_p)
13280 (Fx_selection_exists_p): New optional frame arg.
13281 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13282 (x_handle_selection_clear): Don't treat other terminals with the
13283 same keyboard specially. Use the terminal-local Vselection_alist.
13284 (x_clear_frame_selections): Use Frun_hook_with_args.
13286 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13288 * xterm.h: Add support for those atoms.
13290 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
13292 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13293 (converted_selections, conversion_fail_tag): New global variables.
13294 (x_selection_request_lisp_error): Free the above.
13295 (x_get_local_selection): Remove unnecessary code.
13296 (x_reply_selection_request): Args changed; handle arbitrary array
13297 of converted selections stored in converted_selections.
13298 Separate the XChangeProperty and SelectionNotify steps.
13299 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13300 (x_convert_selection): New function.
13301 (x_handle_selection_event): Simplify.
13302 (x_get_foreign_selection): Don't ignore incoming requests while
13303 waiting for an answer; this will fail when we implement
13304 SAVE_TARGETS, and seems unnecessary anyway.
13305 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13306 (Vx_sent_selection_functions): Doc fix.
13308 2011-05-26 Leo Liu <sdl.web@gmail.com>
13310 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13312 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13314 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13316 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13317 for fringe update if it has periodic bitmap.
13318 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
13319 and fringe_bitmap_periodic_p.
13321 * fringe.c (get_fringe_bitmap_data): New function.
13322 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13323 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13324 row. Mark glyph row for fringe update if periodicity changed.
13326 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13327 for fringe update unless it has periodic bitmap.
13329 2011-05-25 Kenichi Handa <handa@m17n.org>
13331 * xdisp.c (get_next_display_element): Set correct it->face_id for
13332 a static composition.
13334 2011-05-24 Leo Liu <sdl.web@gmail.com>
13337 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13339 * fns.c (crypto_hash_function, Fsha1): New function.
13340 (Fmd5): Use crypto_hash_function.
13341 (syms_of_fns): Add Ssha1.
13343 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13345 * gnutls.c: Remove unused macros.
13346 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13347 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13348 Remove macros that are defined and never used.
13349 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13351 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13353 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13354 (Fx_get_selection_internal): Minor cleanup.
13355 (Fx_own_selection_internal): Rename arguments for consistency with
13358 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13360 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13362 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13364 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13366 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13368 * dispnew.c (scrolling_window): Don't exclude the case that the
13369 last enabled row in the desired matrix touches the bottom boundary.
13371 2011-05-21 Glenn Morris <rgm@gnu.org>
13373 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
13374 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13375 and add some more files.
13377 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13379 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13380 report_file_error introduced by the change from 2011-05-07.
13382 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13384 * systime.h (Time): Define only if emacs is defined.
13385 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13386 where the include path doesn't have X11/X.h by default. See
13387 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13389 2011-05-20 Kenichi Handa <handa@m17n.org>
13391 * composite.c (find_automatic_composition): Fix previous change.
13393 2011-05-20 Glenn Morris <rgm@gnu.org>
13395 * lisp.mk: New file, split from Makefile.in.
13396 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13397 (shortlisp): Remove.
13398 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13400 2011-05-19 Glenn Morris <rgm@gnu.org>
13402 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13403 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13404 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13405 (lisp): Set the order to that of loadup.el.
13406 (shortlisp): Make it a copy of $lisp.
13407 (SOME_MACHINE_LISP): Remove.
13408 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13409 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13411 2011-05-18 Kenichi Handa <handa@m17n.org>
13413 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13414 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13415 (find_automatic_composition): Mostly rewrite for efficiency.
13417 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
13419 * makefile.w32-in: Update dependencies.
13421 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13423 * menu.c: Include limits.h (fixes the MS-Windows build broken by
13424 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
13426 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
13428 Fix some integer overflow issues, such as string length overflow.
13430 * insdel.c (count_size_as_multibyte): Check for string overflow.
13432 * character.c (lisp_string_width): Check for string overflow.
13433 Use EMACS_INT, not int, for string indexes and lengths; in
13434 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13435 the resulting string length overflows an EMACS_INT; instead,
13436 report a string overflow if no precision given. When checking for
13437 precision exhaustion, use a check that cannot possibly have
13438 integer overflow. (Bug#8675)
13439 * character.h (lisp_string_width): Adjust to new signature.
13441 * alloc.c (string_overflow): New function.
13442 (Fmake_string): Use it. This doesn't change behavior, but saves
13443 a few bytes and will simplify future changes.
13444 * character.c (string_escape_byte8): Likewise.
13445 * lisp.h (string_overflow): New decl.
13447 Fixups, following up to the user-interface timestamp change.
13448 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13449 for UI timestamps, instead of unsigned long.
13450 * msdos.c (mouse_get_pos): Likewise.
13451 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
13452 * w32gui.h (Time): Define by including "systime.h" rather than by
13453 declaring it ourselves. (Bug#8664)
13455 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13456 * image.c (clear_image_cache): Likewise.
13458 * term.c (term_mouse_position): Don't assume time_t wraparound.
13460 Be more systematic about user-interface timestamps.
13461 Before, the code sometimes used 'Time', sometimes 'unsigned long',
13462 and sometimes 'EMACS_UINT', to represent these timestamps.
13463 This change causes it to use 'Time' uniformly, as that's what X uses.
13464 This makes the code easier to follow, and makes it easier to catch
13465 integer overflow bugs such as Bug#8664.
13466 * frame.c (Fmouse_position, Fmouse_pixel_position):
13467 Use Time, not unsigned long, for user-interface timestamps.
13468 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13469 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13470 * keyboard.h (last_event_timestamp): Likewise.
13471 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13472 * menu.h (xmenu_show): Likewise.
13473 * term.c (term_mouse_position): Likewise.
13474 * termhooks.h (struct input_event.timestamp): Likewise.
13475 (struct terminal.mouse_position_hook): Likewise.
13476 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13477 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13478 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13479 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13480 what it was before.
13481 * menu.h, termhooks.h: Include "systime.h", for Time.
13483 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13484 Don't assume that the difference between two unsigned long values
13485 can fit into an integer. At this point, we know button_down_time
13486 <= event->timestamp, so the difference must be nonnegative, so
13487 there's no need to cast the result if double-click-time is
13488 nonnegative, as it should be; check that it's nonnegative, just in
13489 case. This bug is triggered when events are more than 2**31 ms
13490 apart (about 25 days). (Bug#8664)
13492 * xselect.c (last_event_timestamp): Remove duplicate decl.
13493 (x_own_selection): Remove needless cast to unsigned long.
13495 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13496 that always fit in int. Use a sentinel instead of a counter, to
13497 avoid a temp and to allay GCC's concerns about possible int overflow.
13498 * frame.h (struct frame): Use int for menu_bar_items_used
13499 instead of EMACS_INT, since it always fits in int.
13501 * menu.c (grow_menu_items): Check for int overflow.
13503 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13505 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13506 Before, the code was not consistent. These values cannot exceed
13507 2**31 - 1 so there's no need to make them unsigned.
13508 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13509 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13510 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13512 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13514 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13515 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13516 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13517 presumably because the widths might not match.
13519 * window.c (size_window): Avoid needless test at loop start.
13521 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13523 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13525 2011-05-12 Drew Adams <drew.adams@oracle.com>
13527 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13529 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13531 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13532 `width' to `bar_area_x' and `bar_area_width', respectively.
13533 (x_scroll_run): Take account of fringe background extension.
13535 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13536 Rename local vars `left' and `width' to `bar_area_x' and
13537 `bar_area_width', respectively.
13538 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13539 background extension.
13541 2011-05-10 Jim Meyering <meyering@redhat.com>
13543 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13545 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
13547 * image.c (Finit_image_library): Return t for built-in image types,
13548 like pbm and xbm. (Bug#8640)
13550 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13552 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13554 2011-05-07 Eli Zaretskii <eliz@gnu.org>
13556 * w32console.c (Fset_screen_color): Doc fix.
13557 (Fget_screen_color): New function.
13558 (syms_of_ntterm): Defsubr it.
13560 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13561 unlink the temporary file if Fcall_process didn't create it in the
13563 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13564 child process will be redirected to a file specified with `:file'.
13565 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13566 cue to call_process_cleanup not to close that handle.
13568 2011-05-07 Ben Key <bkey76@gmail.com>
13570 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13571 one of two shell specific rules, either bootstrap-temacs-CMD or
13572 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13573 to the previous implementation of the bootstrap-temacs rule.
13574 The bootstrap-temacs-CMD rule is similar to the previous
13575 implementation of the bootstrap-temacs rule except that it
13576 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13579 These changes, along with some changes to nt/configure.bat,
13580 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13581 earlier fix to add support for --cflags and --ldflags options
13582 that include quotes so that it works whether make uses cmd or
13585 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
13587 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13588 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13590 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13591 a string. Handle both cases.
13592 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13593 (Fdbus_register_method): Use Qinvalid_function.
13595 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13597 * makefile.w32-in: Update dependencies.
13598 (LISP_H): Add inttypes.h and stdin.h.
13599 (PROCESS_H): Add unistd.h.
13601 2011-05-06 Eli Zaretskii <eliz@gnu.org>
13603 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13604 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13606 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
13608 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13610 * term.c (vfatal): Remove stray call to va_end.
13611 It's not needed and the C Standard doesn't allow it here anyway.
13613 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13614 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13616 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13619 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13621 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13623 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13625 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13627 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13629 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13630 * charset.c (Fdefine_charset_internal): Don't initialize
13631 charset.code_space[15]. The value was garbage, on hosts with
13632 32-bit int (Bug#8600).
13634 * lread.c (read_integer): Be more consistent with string-to-number.
13635 Use string_to_number to do the actual conversion; this avoids
13636 rounding errors and fixes some other screwups. Without this fix,
13637 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13638 (digit_to_number): Move earlier, for benefit of read_integer.
13639 Return -1 if the digit is out of range for the base, -2 if it is
13640 not a digit in any supported base. (Bug#8602)
13642 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13644 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13645 to match comment at start of function. This also removes a
13646 GCC warning about overflow in a 32+64-bit port.
13648 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13650 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13651 Reported by Stefan Monnier in
13652 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
13653 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13654 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
13656 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13657 (EMACS_UINTPTR): Likewise, with uintptr_t.
13659 * lisp.h: Prefer 64-bit EMACS_INT if available.
13660 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13661 on 32-bit hosts that have 64-bit int, so that they can access
13663 However, temporarily disable this change unless the temporary
13664 symbol WIDE_EMACS_INT is defined.
13666 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13668 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13669 This removes an assumption that EMACS_INT and long are the same
13670 width as pointers. The assumption is true for Emacs porting targets
13671 now, but we want to make other targets possible.
13672 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13673 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13674 In the rest of the code, change types of integers that hold casted
13675 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13676 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13677 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13678 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13679 No need to cast type when ORing.
13680 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13681 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13682 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13683 assume EMACS_INT is the same width as char *.
13684 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13685 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13686 Remove no-longer-needed casts.
13687 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13688 (xg_tool_bar_help_callback, xg_make_tool_item):
13689 Use EMACS_INTPTR to hold an integer
13690 that will be cast to void *; this can avoid a GCC warning
13691 if EMACS_INT is not the same width as void *.
13692 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13693 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13694 (current_message_1, set_message_1):
13695 Use a local to convert to proper width without a cast.
13696 * xmenu.c (dialog_selection_callback): Likewise.
13698 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13699 Also, don't assume VALBITS / RAND_BITS is less than 5,
13700 and don't rely on undefined behavior when shifting a 1 left into
13702 * lisp.h (get_random): Change signature to match.
13704 * lread.c (hash_string): Use size_t, not int, for hash computation.
13705 Normally we prefer signed values; but hashing is special, because
13706 it's better to use unsigned division on hash table sizes so that
13707 the remainder is nonnegative. Also, size_t is the natural width
13708 for hashing into memory. The previous code used 'int', which doesn't
13709 retain enough info to hash well into very large tables.
13710 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13712 * dbusbind.c: Don't possibly lose pointer info when converting.
13713 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13714 Use XPNTR rather than XHASH, so that the high-order bits of
13715 the pointer aren't lost when converting through void *.
13717 * eval.c (Fautoload): Don't double-shift a pointer.
13719 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13721 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13723 * gnutls.c (DEF_GNUTLS_FN):
13724 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13726 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13728 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13731 2011-05-05 Eli Zaretskii <eliz@gnu.org>
13733 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13734 New version that can reserve upto 2GB of heap space.
13736 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
13738 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13740 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13742 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13743 `gnutls_certificate_set_x509_key_file'.
13745 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
13747 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13748 Update dependencies.
13750 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13752 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13753 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13754 Remove unused parameter `fildes'.
13755 * process.c (read_process_output, send_process): Don't pass it.
13757 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13759 Fix previous change: the library cache is defined in w32.c.
13760 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13761 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13763 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13765 Implement dynamic loading of GnuTLS on Windows.
13767 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13768 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13769 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13772 * gnutls.c (Qgnutls_dll): Define.
13773 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13774 (gnutls_*): Declare function pointers.
13775 (init_gnutls_functions): New function to initialize function pointers.
13776 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13777 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13778 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13779 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13780 (emacs_gnutls_write, emacs_gnutls_read)
13781 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13782 (Fgnutls_available_p): New function.
13783 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13784 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13785 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13787 * image.c: Include w32.h.
13788 (Vimage_type_cache): Delete.
13789 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13790 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13791 (w32_delayed_load): Move to w32.c.
13793 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13795 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13796 (w32_delayed_load): Move from image.c. When loading a library, record
13797 its filename in the :loaded-from property of the library id.
13798 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13799 Initialize and staticpro them.
13800 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13802 * process.c: Include lisp.h before w32.h, not after.
13803 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13804 instead of gnutls_record_check_pending.
13806 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13808 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13810 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13811 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13814 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13816 * xterm.c (x_set_frame_alpha): Do not set property on anything
13817 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13819 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13821 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13823 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13825 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13826 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13827 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13828 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13829 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13830 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13831 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13832 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13833 (Qgnutls_bootprop_callbacks_verify): Make static.
13835 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13837 * callproc.c: Indentation fixup.
13839 * sysdep.c (wait_for_termination_1): Make static.
13840 (wait_for_termination, interruptible_wait_for_termination):
13841 Move after wait_for_termination_1.
13843 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13845 * sysdep.c (interruptible_wait_for_termination): New function
13846 which is like wait_for_termination, but allows keyboard
13849 * callproc.c (Fcall_process): Add (:file "file") as an option for
13851 (Fcall_process_region): Ditto.
13853 2011-04-30 Eli Zaretskii <eliz@gnu.org>
13855 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13856 rather than `XVECTOR (FOO)->size'.
13858 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13859 inttypes.h, as a gnulib replacement is used if it not available in
13862 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13864 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13865 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13866 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13868 * coding.c (coding_alloc_by_realloc): Error out if destination
13869 will grow beyond MOST_POSITIVE_FIXNUM.
13870 (decode_coding_emacs_mule): Abort if there isn't enough place in
13871 charbuf for the composition carryover bytes. Reserve an extra
13872 space for up to 2 characters produced in a loop.
13873 (decode_coding_iso_2022): Abort if there isn't enough place in
13874 charbuf for the composition carryover bytes.
13876 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13878 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13879 aborting when %lld or %lll format is passed.
13880 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13881 %llo or %llx format is passed. (Bug#8545)
13883 * window.c (window_scroll_line_based): Use a marker instead of
13884 simple variables to record original value of point. (Bug#7952)
13886 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13887 produced by %s or %c overflows available buffer space. (Bug#8545)
13889 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13891 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
13892 (SIZE_MAX): Move defn after all includes, as they might #define it.
13894 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13896 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13898 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13900 * keyboard.c (Qdelayed_warnings_hook): Define.
13901 (command_loop_1): Run `delayed-warnings-hook'
13902 if Vdelayed_warnings_list is non-nil.
13903 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13904 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13906 2011-04-28 Eli Zaretskii <eliz@gnu.org>
13908 * doprnt.c (doprnt): Don't return value smaller than the buffer
13909 size if the message was truncated. (Bug#8545).
13911 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13913 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13914 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13916 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13918 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13920 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
13922 * makefile.w32-in: Update dependencies.
13924 2011-04-27 Eli Zaretskii <eliz@gnu.org>
13926 Improve `doprnt' and its usage. (Bug#8545)
13927 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13928 `format_end'. Remove support for %l as a conversion specifier.
13929 Don't use xrealloc. Improve diagnostics when the %l size modifier
13930 is used. Update the commentary.
13932 * eval.c (verror): Simplify calculation of size_t.
13934 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13937 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13939 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13942 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13944 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13945 This makes this file independent of the recent pseudovector change.
13947 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
13949 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13951 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
13952 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
13953 Remove unused local.
13954 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
13956 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
13957 GCC 4.6.0 optimizes based on type-based alias analysis.
13958 For example, if b is of type struct buffer * and v of type struct
13959 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13960 != &v->size, and therefore "v->size = 1; b->size = 2; return
13961 v->size;" must therefore return 1. This assumption is incorrect
13962 for Emacs, since it type-puns struct Lisp_Vector * with many other
13963 types. To fix this problem, this patch adds a new type struct
13964 vectorlike_header that documents the constraints on layout of vectors
13965 and pseudovectors, and helps optimizing compilers not get fooled
13966 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13967 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
13968 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13970 (XSETPVECTYPE): Rewrite in terms of new macro.
13971 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13972 This is a bit clearer, and further avoids the possibility of
13973 undesirable aliasing.
13974 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
13975 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
13976 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13977 since Lisp_Subr is a special case (no "next" field).
13978 (ASIZE): Now uses header.size rather than size.
13979 All previous uses of XVECTOR (foo)->size replaced to use this macro,
13980 to avoid the hassle of writing XVECTOR (foo)->header.size.
13981 (struct vectorlike_header): New type.
13982 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13983 object, to help avoid aliasing.
13984 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13985 (SUBRP): Likewise, since Lisp_Subr is a special case.
13986 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13987 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13988 (struct Lisp_Hash_Table): Combine first two members into a single
13989 struct vectorlike_header member. All uses of "size" and "next" members
13990 changed to be "header.size" and "header.next".
13991 * buffer.h (struct buffer): Likewise.
13992 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13993 * frame.h (struct frame): Likewise.
13994 * process.h (struct Lisp_Process): Likewise.
13995 * termhooks.h (struct terminal): Likewise.
13996 * window.c (struct save_window_data, struct saved_window): Likewise.
13997 * window.h (struct window): Likewise.
13998 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13999 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14000 * buffer.c (init_buffer_once): Likewise.
14001 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14003 * process.c (Fformat_network_address): Use local var for size,
14006 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14008 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14009 * data.c (atof): Remove decl; no longer used or needed.
14010 (digit_to_number): Move to lread.c.
14011 (Fstring_to_number): Use new string_to_number function, to be
14012 consistent with how the Lisp reader treats infinities and NaNs.
14013 Do not assume that floating-point numbers represent EMACS_INT
14014 without losing information; this is not true on most 64-bit hosts.
14015 Avoid double-rounding errors, by insisting on integers when
14016 parsing non-base-10 numbers, as the documentation specifies.
14017 * lisp.h (string_to_number): New decl, replacing ...
14018 (isfloat_string): Remove.
14019 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14020 (read1): Do not accept +. and -. as integers; this
14021 appears to have been a coding error. Similarly, do not accept
14022 strings like +-1e0 as floating point numbers. Do not report
14023 overflow for integer overflows unless the base is not 10 which
14024 means we have no simple and reliable way to continue.
14025 Break out the floating-point parsing into a new
14026 function string_to_number, so that Fstring_to_number parses
14027 floating point numbers consistently with the Lisp reader.
14028 (digit_to_number): Move here from data.c. Make it static inline.
14029 (E_CHAR, EXP_INT): Remove, replacing with ...
14030 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14031 (string_to_number): New function, replacing isfloat_string.
14032 This function checks for valid syntax and produces the resulting
14033 Lisp float number too. Rework it so that string-to-number
14034 no longer mishandles examples like "1.0e+". Use strtoumax,
14035 so that overflow for non-base-10 numbers is reported only when
14036 there's no portable and simple way to convert to floating point.
14038 * textprop.c (set_text_properties_1): Rewrite for clarity,
14039 and to avoid GCC warning about integer overflow.
14041 * intervals.h (struct interval): Use EMACS_INT for members
14042 where EMACS_UINT might cause problems. See
14043 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14044 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14045 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14047 (offset_intervals): Tell GCC not to worry about length overflow
14048 when negating a negative length.
14050 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14051 (overrun_check_free): Likewise.
14053 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14054 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14057 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14058 (gnutls_make_error): Rename local to avoid shadowing.
14059 (gnutls_emacs_global_deinit): ifdef out; not used.
14060 (Fgnutls_boot): Use const for pointer to readonly storage.
14061 Comment out unused local. Fix pointer signedness problems.
14063 * lread.c (openp): Don't stuff size_t into an 'int'.
14064 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14065 about possible signed overflow.
14067 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14068 (GDK_KEY_g): Don't define if already defined.
14069 (xg_prepare_tooltip): Avoid pointer signedness problem.
14070 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14072 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14073 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14075 * xfns.c (Fx_window_property): Simplify a bit,
14076 to make a bit faster and to avoid GCC 4.6.0 warning.
14077 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14079 * fns.c (internal_equal): Don't assume size_t fits in int.
14081 * alloc.c (compact_small_strings): Tighten assertion a little.
14083 Replace pEd with more-general pI, and fix some printf arg casts.
14084 * lisp.h (pI): New macro, generalizing old pEd macro to other
14085 conversion specifiers. For example, use "...%"pI"d..." rather
14086 than "...%"pEd"...".
14087 (pEd): Remove. All uses replaced with similar uses of pI.
14088 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14089 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14090 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14091 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14092 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14093 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14094 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14096 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14097 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14098 * print.c (safe_debug_print, print_object): Likewise.
14099 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14101 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14102 avoiding the 0 flag, which is not portable.
14103 * process.c (Fmake_network_process): Use pI to avoid cast.
14104 * region-cache.c (pp_cache): Likewise.
14105 * xdisp.c (decode_mode_spec): Likewise.
14106 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14107 behavior on 64-bit hosts with printf arg.
14108 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14109 (x_stop_queuing_selection_requests): Likewise.
14110 (x_get_window_property): Don't truncate byte count to an 'int'
14113 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14114 here, since it parses constructs like leading '-' and spaces,
14115 which are not wanted; and it overflows with large numbers.
14116 Instead, simply match F[0-9]+, which is what is wanted anyway.
14118 * alloc.c: Remove unportable assumptions about struct layout.
14119 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14120 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14121 (allocate_vectorlike, make_pure_vector): Use the new macros,
14122 plus offsetof, to remove unportable assumptions about struct layout.
14123 These assumptions hold on all porting targets that I know of, but
14124 they are not guaranteed, they're easy to remove, and removing them
14125 makes further changes easier.
14127 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14128 This doesn't fix a bug but makes the code clearer.
14129 (string_overrun_cookie): Now const. Use initializers that
14130 don't formally overflow signed char, to avoid warnings.
14131 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14132 can cause Emacs to crash when string overrun checking is enabled.
14133 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14134 multiple of sizeof (EMACS_INT); it need not be, if
14135 alignof(EMACS_INT) < sizeof (EMACS_INT).
14136 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14138 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14140 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14142 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14144 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14145 supposed to be handshaking. (Bug#8556)
14146 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14148 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14150 * lisp.h (Qdebug): List symbol.
14151 * eval.c (Qdebug): Restore global linkage.
14152 * keyboard.c (debug-on-event): New variable.
14153 (handle_user_signal): Break into debugger when debug-on-event
14154 matches the current signal symbol.
14156 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14158 * alloc.c (check_sblock, check_string_bytes)
14159 (check_string_free_list): Convert to standard C.
14161 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14163 * w32.c (emacs_gnutls_push): Fix typo.
14165 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14167 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14168 "cast to pointer from integer of different size".
14170 Improve doprnt and its use in verror. (Bug#8545)
14171 * doprnt.c (doprnt): Document the set of format control sequences
14172 supported by the function. Use SAFE_ALLOCA instead of always
14175 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14176 is one byte too soon. Don't use xrealloc; instead xfree and
14179 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14181 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14184 * gnutls.c: Renamed global_initialized to
14185 gnutls_global_initialized. Added internals for the
14186 :verify-hostname-error, :verify-error, and :verify-flags
14187 parameters of `gnutls-boot' and documented those parameters in the
14188 docstring. Start callback support.
14189 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14190 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14191 on error. Return error code.
14192 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14193 (emacs_gnutls_read): Likewise.
14194 (Fgnutls_boot): Return handshake error code.
14195 (emacs_gnutls_handle_error): New function.
14196 (wsaerror_to_errno): Likewise.
14198 * w32.h (emacs_gnutls_pull): Add prototype.
14199 (emacs_gnutls_push): Likewise.
14201 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14202 (emacs_gnutls_push): Likewise.
14204 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14206 * process.c (wait_reading_process_output): Check if GnuTLS
14207 buffered some data internally if no FDs are set for TLS
14210 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14211 (LIBS): Link to USER_LIBS.
14212 ($(BLD)/gnutls.$(0)): New target.
14214 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14216 * xdisp.c (handle_single_display_spec): Rename the
14217 display_replaced_before_p argument into display_replaced_p, to
14218 make it consistent with the commentary. Fix typos in the
14221 * textprop.c (syms_of_textprop): Remove dead code.
14222 (copy_text_properties): Delete obsolete commentary about an
14223 interface that was deleted long ago. Fix typos in the description
14226 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14227 to changes in oldXMenu/XMenu.h from 2011-04-16.
14228 <menu_help_message, prev_menu_help_message>: Constify.
14229 (IT_menu_make_room): menu->help_text is now `const char **';
14232 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14233 to changes in oldXMenu/XMenu.h from 2011-04-16.
14234 (struct XMenu): Declare `help_text' `const char **'.
14236 * xfaces.c <Qunspecified>: Make extern again.
14238 * syntax.c: Include sys/types.h before including regex.h, as
14241 * doc.c (get_doc_string): Improve the format passed to `error'.
14243 * doprnt.c (doprnt): Improve commentary.
14245 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14247 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14250 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14251 changes in globals.h immediately force recompilation.
14252 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14253 $(CURDIR)/s/ms-w32.h.
14254 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
14256 * character.c (Fchar_direction): Function deleted.
14257 (syms_of_character): Don't defsubr it.
14258 <char-direction-table>: Deleted.
14260 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14262 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14263 * doprnt.c: Include limits.h.
14264 (SIZE_MAX): New macro.
14265 (doprnt): Return a size_t value. 2nd arg is now size_t.
14266 Many local variables are now size_t instead of int or unsigned.
14267 Improve overflow protection. Support `l' modifier for integer
14268 conversions. Support %l conversion. Don't assume an EMACS_INT
14269 argument for integer conversions and for %c.
14271 * lisp.h (doprnt): Restore prototype.
14273 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14274 $(SRC)/character.h.
14276 * Makefile.in (base_obj): Add back doprnt.o.
14278 * deps.mk (doprnt.o): Add back prerequisites.
14279 (callint.o): Depend on character.h.
14281 * eval.c (internal_lisp_condition_case): Include the handler
14282 representation in the error message.
14283 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14284 when breaking from the loop.
14286 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14288 * callint.c (Fcall_interactively): When displaying error message
14289 about invalid control letter, pass the character's codepoint, not
14290 a pointer to its multibyte form. Improve display of the character
14291 in octal and display also its hex code.
14293 * character.c (char_string): Use %x to display the (unsigned)
14294 codepoint of an invalid character, to avoid displaying a bogus
14297 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14298 `error', not SYMBOL_NAME itself.
14300 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14301 character arguments to `error'.
14303 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14304 to `error' in error message about FINAL_CHAR argument. Make sure
14305 FINAL_CHAR is a character, and use %c when it is passed as
14306 argument to `error'.
14308 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14310 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14312 * w32.c: Include <time.h>.
14313 (sys_localtime): New function.
14315 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
14317 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14319 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14321 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
14323 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14324 zombies (Bug#8467).
14326 2011-04-19 Eli Zaretskii <eliz@gnu.org>
14328 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14329 gl_state.e_property when gl_state.object is Qt.
14331 * insdel.c (make_gap_larger): Remove limitation of buffer size
14334 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
14336 * xdisp.c (lookup_glyphless_char_display)
14337 (produce_glyphless_glyph): Handle cons cell entry in
14338 glyphless-char-display.
14339 (Vglyphless_char_display): Document it.
14341 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14342 glyphless-char-display.
14344 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
14346 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14348 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14350 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14351 definition for no-X builds.
14353 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
14355 Static checks with GCC 4.6.0 and non-default toolkits.
14357 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14359 * process.c (keyboard_bit_set): Define only if SIGIO.
14360 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14361 (send_process): Repair possible setjmp clobbering.
14363 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14365 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14367 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14369 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14370 Define only if needed.
14372 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14373 by pacifying GCC about it. Maybe it's time to retire it?
14374 * xfaces.c (USG, __TIMEVAL__): Likewise.
14376 * dispextern.h (struct redisplay_interface): Rename param
14377 to avoid shadowing.
14378 * termhooks.h (struct terminal): Likewise.
14379 * xterm.c (xembed_send_message): Likewise.
14381 * insdel.c (make_gap_smaller): Define only if
14382 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14384 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14387 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14388 so that we aren't warned about unused symbols.
14390 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14392 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14394 * xfns.c (x_real_positions): Mark locals as initialized.
14396 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14398 * xterm.c: Fix problems found by static analysis with other toolkits.
14399 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
14400 (x_dispatch_event): Declare static if USE_GTK, and
14401 define if USE_GTK || USE_X_TOOLKIT.
14402 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
14403 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
14404 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14405 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
14407 * xmenu.c (menu_help_callback): Pointer type fixes.
14408 Use const pointers when pointing at readonly data. Avoid pointer
14409 signedness clashes.
14410 (FALSE): Remove unused macro.
14411 (update_frame_menubar): Remove unused decl.
14413 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14415 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14416 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14417 (single_menu_item): Rename local to avoid shadowing.
14419 * keyboard.c (make_lispy_event): Remove unused local var.
14421 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14422 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14424 * bitmaps: Change bitmaps from unsigned char back to the X11
14425 compatible char. Avoid the old compiler warnings about
14426 out-of-range initializers by using, for example, '\xab' rather
14429 * xgselect.c (xgselect_initialize): Check vs interface
14430 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14432 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14434 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14435 to read-only memory.
14437 * fns.c (vector): Remove; this old hack is no longer needed.
14439 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
14441 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
14443 * xrdb.c (x_load_resources): Omit unused local.
14445 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
14446 (x_window): Rename locals to avoid shadowing.
14447 (USG): Use the kludged USG macro, to pacify gcc.
14449 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
14450 (x_term_init): Remove local to avoid shadowing.
14452 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
14454 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14455 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14457 2011-04-16 Eli Zaretskii <eliz@gnu.org>
14459 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14461 Fix regex.c, syntax.c and friends for buffers > 2GB.
14462 * syntax.h (struct gl_state_s): Declare character position members
14465 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14467 * textprop.c (verify_interval_modification, interval_of):
14468 Declare arguments EMACS_INT.
14470 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14473 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14475 * indent.c (Fvertical_motion): Local variable it_start is now
14478 * regex.c (re_match, re_match_2, re_match_2_internal)
14479 (bcmp_translate, regcomp, regexec, print_double_string)
14480 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14481 (re_compile_pattern, re_exec): Declare arguments and local
14482 variables `size_t' and `ssize_t' and return values `regoff_t', as
14484 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14485 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14486 <compile_stack_type>: `size' and `avail' are now `size_t'.
14488 * regex.h <regoff_t>: Use ssize_t, not int.
14489 (re_search, re_search_2, re_match, re_match_2): Arguments that
14490 specify buffer/string position and length are now ssize_t and
14491 size_t. Return type is regoff_t.
14493 2011-04-16 Ben Key <bkey76@gmail.com>
14495 * nsfont.m: Fixed bugs in ns_get_family and
14496 ns_descriptor_to_entity that were caused by using free to
14497 deallocate memory blocks that were allocated by xmalloc (via
14498 xstrdup). This caused Emacs to crash when compiled with
14499 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14500 --enable-checking=xmallocoverrun). xfree is now used to
14501 deallocate these memory blocks.
14503 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
14505 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14507 emacs_write: Accept and return EMACS_INT for sizes.
14508 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14510 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14511 Accept and return EMACS_INT.
14512 (emacs_gnutls_write): Return the number of bytes written on
14514 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
14515 (emacs_read, emacs_write): Remove check for negative size, as the
14516 Emacs source code has been audited now.
14517 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14518 (emacs_read, emacs_write): Use it.
14519 * process.c (send_process): Adjust to the new signatures of
14520 emacs_write and emacs_gnutls_write. Do not attempt to store
14521 a byte offset into an 'int'; it might overflow.
14522 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
14524 * sound.c: Don't assume sizes fit in 'int'.
14525 (struct sound_device.period_size, alsa_period_size):
14526 Return EMACS_INT, not int.
14527 (struct sound_device.write, vox_write, alsa_write):
14528 Accept EMACS_INT, not int.
14529 (wav_play, au_play): Use EMACS_INT to store sizes and to
14530 record read return values.
14532 2011-04-15 Ben Key <bkey76@gmail.com>
14534 * keyboard.c (Qundefined): Don't declare static since it is used
14536 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14537 static since they are used in nsfont.m.
14539 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14541 * process.c (Qprocessp): Don't declare static.
14542 * lisp.h (Qprocessp): Declare again.
14544 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
14546 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14548 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14550 Improve C-level modularity by making more things 'static'.
14552 Don't publish debugger-only interfaces to other modules.
14553 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14554 (verify_bytepos, count_markers): Move decls to the only modules
14556 * region-cache.h (pp_cache): Likewise.
14557 * window.h (check_all_windows): Likewise.
14558 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14560 * sysdep.c (croak): Now static, if
14561 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14562 * syssignal.h (croak): Declare only if not static.
14564 * alloc.c (refill_memory_reserve): Now static if
14565 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14566 * lisp.h (refill_memory_reserve): Declare only if not static.
14568 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14569 Define only if USE_LUCID.
14571 * xrdb.c (x_customization_string, x_rm_string): Now static.
14573 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14574 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14576 * xdisp.c (draw_row_with_mouse_face): Now static.
14577 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14579 * window.h (check_all_windows): Mark externally visible.
14581 * window.c (window_deletion_count): Now static.
14583 * undo.c: Make symbols static if they're not exported.
14584 (last_undo_buffer, last_boundary_position, pending_boundary):
14587 * textprop.c (interval_insert_behind_hooks): Now static.
14588 (interval_insert_in_front_hooks): Likewise.
14590 * term.c: Make symbols static if they're not exported.
14591 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14592 (max_frame_lines, tty_set_terminal_modes):
14593 (tty_reset_terminal_modes, tty_turn_off_highlight):
14594 (get_tty_terminal): Now static.
14595 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14596 * termhooks.h (term_mouse_moveto): Do not declare if
14597 HAVE_WINDOW_SYSTEM.
14598 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14599 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14601 * sysdep.c: Make symbols static if they're not exported.
14602 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14604 (sigprocmask_set, full_mask): Remove; unused.
14605 (wait_debugging): Mark as visible.
14606 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14607 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14609 * syntax.c (syntax_temp): Define only if !__GNUC__.
14611 * sound.c (current_sound_device, current_sound): Now static.
14613 * search.c (searchbufs, searchbuf_head): Now static.
14615 * scroll.c (scroll_cost): Remove; unused.
14616 * dispextern.h (scroll_cost): Remove decl.
14618 * region-cache.h (pp_cache): Mark as externally visible.
14620 * process.c: Make symbols static if they're not exported.
14621 (process_tick, update_tick, create_process, chan_process):
14622 (Vprocess_alist, proc_buffered_char, datagram_access):
14623 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14624 (deactivate_process): Mark defn as static, as well as decl.
14625 * lisp.h (create_process): Remove decl.
14626 * process.h (chan_process, Vprocess_alist): Remove decls.
14628 * print.c: Make symbols static if they're not exported.
14629 (print_depth, new_backquote_output, being_printed, print_buffer):
14630 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14631 (print_interval, print_number_index, initial_stderr_stream):
14633 * lisp.h (Fprinc): Remove decl.
14634 (debug_output_compilation_hack): Mark as externally visible.
14636 * sysdep.c (croak): Move decl from here to syssignal.h.
14637 * syssignal.h (croak): Put it here, so the API can be checked when
14638 'croak' is called from dissociate_if_controlling_tty.
14640 * minibuf.c: Make symbols static if they're not exported.
14641 (minibuf_save_list, choose_minibuf_frame): Now static.
14642 * lisp.h (choose_minibuf_frame): Remove decl.
14644 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14646 * lread.c: Make symbols static if they're not exported.
14647 (read_objects, initial_obarray, oblookup_last_bucket_number):
14649 (make_symbol): Remove; unused.
14650 * lisp.h (initial_obarray, make_symbol): Remove decls.
14652 * keyboard.c: Make symbols static if they're not exported.
14653 (single_kboard, recent_keys_index, total_keys, recent_keys):
14654 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14655 (this_single_command_key_start, echoing, last_auto_save):
14656 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14657 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14658 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14659 (Vlispy_mouse_stem, double_click_count):
14661 (force_auto_save_soon): Define only if SIGDANGER.
14662 (ignore_mouse_drag_p): Now static if
14663 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14664 (print_help): Remove; unused.
14665 (stop_character, last_timer_event): Mark as externally visible.
14666 * keyboard.h (ignore_mouse_drag_p): Declare only if
14667 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14668 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14669 * lisp.h (echoing): Remove decl.
14670 (force_auto_save_soon): Declare only if SIGDANGER.
14671 * xdisp.c (redisplay_window): Simplify code, to make it more
14672 obvious that ignore_mouse_drag_p is not accessed if !defined
14673 USE_GTK && !defined HAVE_NS.
14675 * intervals.c: Make symbols static if they're not exported.
14676 (merge_properties_sticky, merge_interval_right, delete_interval):
14678 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14680 * insdel.c: Make symbols static if they're not exported.
14681 However, leave prepare_to_modify_buffer alone. It's never
14682 called from outside this function, but that appears to be a bug.
14683 (combine_after_change_list, combine_after_change_buffer):
14684 (adjust_after_replace, signal_before_change): Now static.
14685 (adjust_after_replace_noundo): Remove; unused.
14686 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
14687 (signal_before_change): Remove decls.
14689 * indent.c (val_compute_motion, val_vmotion): Now static.
14691 * image.c: Make symbols static if they're not exported.
14692 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14694 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14695 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14697 * fringe.c (standard_bitmaps): Now static.
14698 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14700 * frame.c: Make symbols static if they're not exported.
14701 (x_report_frame_params, make_terminal_frame): Now static.
14702 (get_frame_param): Now static, unless HAVE_NS.
14703 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14704 (x_get_resource_string): Remove; not used.
14705 * frame.h (make_terminal_frame, x_report_frame_params):
14706 (x_get_resource_string); Remove decls.
14707 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14708 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14710 * font.c, fontset.c: Make symbols static if they're not exported.
14711 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14712 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14713 * font.c (font_close_object): Now static.
14714 * font.h (font_close_object): Remove.
14715 * fontset.c (FONTSET_OBJLIST): Remove.
14716 (free_realized_fontset) #if-0 the body, which does nothing.
14717 (face_suitable_for_char_p): #if-0, as it's never called.
14718 * fontset.h (face_suitable_for_char_p): Remove decl.
14719 * xfaces.c (face_at_string_position):
14720 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
14721 since 0 is always ASCII.
14723 * fns.c (weak_hash_tables): Now static.
14725 * fileio.c: Make symbols static if they're not exported.
14726 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14727 (Vwrite_region_annotation_buffers): Now static.
14729 * eval.c: Make symbols static if they're not exported.
14730 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14731 * lisp.h (backtrace_list): Remove decl.
14733 * emacs.c: Make symbols static if they're not exported.
14734 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14735 (fatal_error_code, fatal_error_signal_hook, standard_args):
14737 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14738 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14739 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14740 * lisp.h (fatal_error_signal_hook): Remove decl.
14741 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14743 * editfns.c: Move a (normally-unused) function to its only use.
14744 * editfns.c, lisp.h (get_operating_system_release): Remove.
14745 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14746 worth the hassle of breaking this out.
14748 * xterm.c: Make symbols static if they're not exported.
14749 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14750 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14751 (x_destroy_window, x_delete_display):
14753 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14754 (x_mouse_leave): Remove; unused.
14755 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14756 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14757 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14759 (x_mouse_leave): Declare only if WINDOWSNT.
14760 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14761 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14764 * ftxfont.c: Make symbols static if they're not exported.
14765 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14767 * font.h (ftxfont_driver): Likewise.
14769 * xfns.c: Make symbols static if they're not exported.
14770 (x_last_font_name, x_display_info_for_name):
14771 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14772 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14773 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14774 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14775 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14776 (last_show_tip_args): Now static.
14777 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14778 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14779 (x_screen_planes): Remove; unused.
14780 * dispextern.h (x_screen_planes): Remove decl.
14782 * dispnew.c: Make symbols static if they're not exported.
14783 * dispextern.h (redraw_garbaged_frames, scrolling):
14784 (increment_row_positions): Remove.
14785 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14786 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14788 (redraw_garbaged_frames): Remove; unused.
14790 * xfaces.c: Make symbols static if they're not exported.
14791 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14793 * xterm.h (defined_color): Remove decls.
14794 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14795 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14796 (menu_face_changed_default, defined_color, free_realized_face):
14797 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14798 (ascii_face_of_lisp_face): Remove; unused.
14800 * xdisp.c: Make symbols static if they're not exported.
14801 * dispextern.h (scratch_glyph_row, window_box_edges):
14802 (glyph_to_pixel_coords, set_cursor_from_row):
14803 (get_next_display_element, set_iterator_to_next):
14804 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14805 (show_mouse_face): Remove decls
14806 * frame.h (message_buf_print): Likewise.
14807 * lisp.h (pop_message, set_message, check_point_in_composition):
14809 * xterm.h (set_vertical_scroll_bar): Likewise.
14810 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14811 (message_buf_print, scratch_glyph_row, displayed_buffer):
14812 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14813 (get_next_display_element, show_mouse_face, window_box_edges):
14814 (frame_to_window_pixel_xy, check_point_in_composition):
14815 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14816 (glyph_to_pixel_coords): Remove; unused.
14818 * dired.c (file_name_completion): Now static.
14820 * dbusbind.c (xd_in_read_queued_messages): Now static.
14822 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14823 * data.c (circular_list_error): Remove.
14825 * commands.h (last_point_position, last_point_position_buffer):
14826 (last_point_position_window): Remove decls.
14827 * keyboard.c: Make these variables static.
14829 * coding.h (coding, code_convert_region, encode_coding_gap):
14831 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14832 (iso_code_class, detect_coding, code_convert_region): Now static.
14833 (encode_coding_gap): Remove; unused.
14835 * chartab.c (chartab_chars, chartab_bits): Now static.
14837 * charset.h (charset_iso_8859_1): Remove decl.
14838 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14841 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14842 * ccl.c (Vccl_program_table): Now static.
14843 (check_ccl_update): Remove; unused.
14845 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14846 * category.h: ... from here.
14847 * category.c (check_category_table, set_category_set): Now static.
14849 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14850 * lisp.h: Remove these decls.
14852 * buffer.c (buffer_count): Remove unused var.
14854 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14855 so that it's not optimized away.
14856 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14857 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14858 exported only to the debugger.
14860 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
14861 * atimer.h (run_all_atimers): Remove; not exported.
14863 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14864 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14865 was inaccessible from Lisp.
14866 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14867 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14869 alloc.c: Import and export fewer symbols, and remove unused items.
14870 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14872 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14873 it's not optimized away by whole-program optimization.
14874 (message_enable_multibyte, free_misc): Remove.
14875 (catchlist, handlerlist, mark_backtrace):
14876 Declare only if BYTE_MARK_STACK.
14877 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14878 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14879 (message_enable_multibyte): Remove decl.
14880 (free_misc, interval_free_list, float_block, float_block_index):
14881 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14882 (cons_free_list, last_marked_index):
14884 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14885 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14886 (mark_backtrace): Define only if BYTE_MARK_STACK.
14887 * xdisp.c (message_enable_multibyte): Now static.
14889 Declare Lisp_Object Q* variables to be 'static' if not exported.
14890 This makes it easier for human readers (and static analyzers)
14891 to see whether these variables are used from other modules.
14892 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14893 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14894 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14895 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14896 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14897 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14898 * xmenu.c, xselect.c:
14899 Declare Q* vars static if they are not used in other modules.
14900 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14901 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14902 Remove decls of unexported vars.
14903 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14905 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14907 Make Emacs functions such as Fatom 'static' by default.
14908 This makes it easier for human readers (and static analyzers)
14909 to see whether these functions can be called from other modules.
14910 DEFUN now defines a static function. To make the function external
14911 so that it can be used in other C modules, use the new macro DEFUE.
14912 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14913 (Finit_image_library):
14914 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14915 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14916 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14917 Remove decls, since these functions are now static.
14918 (Funintern, Fget_internal_run_time): New decls, since these functions
14919 were already external.
14921 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14922 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14923 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14924 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14925 * keyboard.c, keymap.c, lread.c:
14926 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14927 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14928 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14929 Mark functions with DEFUE instead of DEFUN,
14930 if they are used in other modules.
14931 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14932 decls for now-static functions.
14933 * buffer.h (Fdelete_overlay): Remove decl.
14934 * callproc.c (Fgetenv_internal): Mark as internal.
14935 * composite.c (Fremove_list_of_text_properties): Remove decl.
14936 (Fcomposition_get_gstring): New forward static decl.
14937 * composite.h (Fcomposite_get_gstring): Remove decl.
14938 * dired.c (Ffile_attributes): New forward static decl.
14939 * doc.c (Fdocumntation_property): New forward static decl.
14940 * eval.c (Ffetch_bytecode): New forward static decl.
14941 (Funintern): Remove extern decl; now in .h file where it belongs.
14942 * fileio.c (Fmake_symbolic_link): New forward static decl.
14943 * image.c (Finit_image_library): New forward static decl.
14944 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14945 * intervals.h (Fprevious_property_change):
14946 (Fremove_list_of_text_properties): Remove decls.
14947 * keyboard.c (Fthis_command_keys): Remove decl.
14948 (Fcommand_execute): New forward static decl.
14949 * keymap.c (Flookup_key): New forward static decl.
14950 (Fcopy_keymap): Now static.
14951 * keymap.h (Flookup_key): Remove decl.
14952 * process.c (Fget_process): New forward static decl.
14953 (Fprocess_datagram_address): Mark as internal.
14954 * syntax.c (Fsyntax_table_p): New forward static decl.
14955 (skip_chars): Remove duplicate decl.
14956 * textprop.c (Fprevious_property_change): New forward static decl.
14957 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14959 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14960 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14962 * editfns.c (Fformat): Remove unreachable code.
14964 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14966 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14969 2011-04-13 Eli Zaretskii <eliz@gnu.org>
14971 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14972 when at ZV. (Bug#8487)
14974 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14976 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14978 * keyboard.c (parse_tool_bar_item): Likewise.
14979 * sound.c (sound_cleanup, alsa_close): Likewise.
14980 * termcap.c (tgetent): Likewise.
14981 * xfns.c (x_default_font_parameter): Likewise.
14982 * xsettings.c (read_and_apply_settings): Likewise.
14984 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14985 (overrun_check_free): Protoize.
14987 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14989 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14990 since callers should never pass a negative size.
14991 Change the signature to match that of plain 'read' and 'write'; see
14992 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14993 * lisp.h: Update prototypes of emacs_write and emacs_read.
14995 2011-04-11 Eli Zaretskii <eliz@gnu.org>
14997 * xdisp.c (redisplay_window): Don't try to determine the character
14998 position of the scroll margin if the window start point w->startp
14999 is outside the buffer's accessible region. (Bug#8468)
15001 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15003 Fix write-region and its subroutines for buffers > 2GB.
15004 * fileio.c (a_write, e_write): Modify declaration of arguments and
15005 local variables to support buffers larger than 2GB.
15006 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15008 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15009 argument, local variables, and return value.
15011 * lisp.h: Update prototypes of emacs_write and emacs_read.
15013 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15015 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15017 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15019 Fix more problems found by GCC 4.6.0's static checks.
15021 * xdisp.c (vmessage): Use a better test for character truncation.
15023 * charset.c (load_charset_map): <, not <=, for optimization,
15024 and to avoid potential problems with integer overflow.
15025 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15026 * casetab.c (set_identity, shuffle): Likewise.
15027 * editfns.c (Fformat): Likewise.
15028 * syntax.c (skip_chars): Likewise.
15030 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15031 This also lets GCC 4.6.0 generate slightly better loop code.
15033 * callint.c (Fcall_interactively): <, not <=, for optimization.
15034 (Fcall_interactively): Count the number of arguments produced,
15035 not the number of arguments given. This is simpler and lets GCC
15036 4.6.0 generate slightly better code.
15038 * ftfont.c: Distingish more carefully between FcChar8 and char.
15039 The previous code passed unsigned char * to a functions like
15040 strlen and xstrcasecmp that expect char *, which does not
15041 conform to the C standard.
15042 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15043 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15044 char * when the C standard requires it.
15046 * keyboard.c (read_char): Remove unused var.
15048 * eval.c: Port to Windows vsnprintf (Bug#8435).
15049 Include <limits.h>.
15050 (SIZE_MAX): Define if the headers do not.
15051 (verror): Do not give up if vsnprintf returns a negative count.
15052 Instead, grow the buffer. This ports to Windows vsnprintf, which
15053 does not conform to C99. Problem reported by Eli Zaretskii.
15054 Also, simplify the allocation scheme, by avoiding the need for
15055 calling realloc, and removing the ALLOCATED variable.
15057 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15059 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15060 But keep the doprint source code for now, as we might revamp it
15061 and use it again (Bug#8435).
15062 * lisp.h (doprnt): Remove.
15063 * Makefile.in (base_obj): Remove doprnt.o.
15064 * deps.mk (doprnt.o): Remove.
15066 error: Print 32- and 64-bit integers portably (Bug#8435).
15067 Without this change, on typical 64-bit hosts error ("...%d...", N)
15068 was used to print both 32- and 64-bit integers N, which relied on
15069 undefined behavior.
15070 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15071 * lisp.h (error, verror): Mark as printf-like functions.
15072 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15073 Report overflow in size calculations when allocating printf buffer.
15074 Do not truncate output string at its first null byte.
15075 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15076 Truncate the output at a character boundary, since vsnprintf does not
15078 * charset.c (check_iso_charset_parameter): Convert internal
15079 character to string before calling 'error', since %c now has the
15081 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15082 overflow when computing char to be passed to 'error'. Do not
15083 pass Lisp_Object to 'error'; pass the integer instead.
15084 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15085 formatted with plain %d.
15087 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15089 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15091 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15093 * xterm.c (x_catch_errors): Remove duplicate declaration.
15095 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15097 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15099 2011-04-10 Jim Meyering <meyering@redhat.com>
15101 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15102 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15103 return ssize_t not "int", and use size_t as the buffer length.
15104 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15105 * gnutls.h: Update declarations.
15106 * process.c (read_process_output): Use ssize_t, to match.
15107 (send_process): Likewise.
15109 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15111 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15113 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15115 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15116 Use unsigned char, to match FcChar8 type definition.
15118 * xterm.c (handle_one_xevent):
15119 * xmenu.c (create_and_show_popup_menu):
15120 * xselect.c (x_decline_selection_request)
15121 (x_reply_selection_request): Avoid type-punned deref of X events.
15123 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15125 Fix some uses of `int' instead of EMACS_INT.
15126 * search.c (string_match_1, fast_string_match)
15127 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15128 (scan_buffer, find_next_newline_no_quit)
15129 (find_before_next_newline, search_command, Freplace_match)
15130 (Fmatch_data): Make some `int' variables be EMACS_INT.
15132 * xdisp.c (display_count_lines): 3rd argument and return value now
15133 EMACS_INT. All callers changed.
15134 (pint2hrstr): Last argument is now EMACS_INT.
15136 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15137 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15138 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15139 (decode_coding_utf_16, decode_coding_emacs_mule)
15140 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15141 (decode_coding_ccl, decode_coding_charset)
15142 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15143 (decode_coding_iso_2022, decode_coding_emacs_mule)
15144 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15145 <char_offset, last_offset>: Declare EMACS_INT.
15146 (encode_coding_utf_8, encode_coding_utf_16)
15147 (encode_coding_emacs_mule, encode_invocation_designation)
15148 (encode_designation_at_bol, encode_coding_iso_2022)
15149 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15150 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15152 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15153 (encode_invocation_designation): Last argument P_NCHARS is now
15155 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15156 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15158 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15161 * ccl.c (Fccl_execute_on_string): Declare some variables
15164 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15166 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15168 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15170 * process.c (Fformat_network_address): Doc fix.
15172 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15174 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15176 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15178 * keyboard.c (read_char): Call Lisp function help-form-show,
15179 instead of using internal_with_output_to_temp_buffer.
15180 (Qhelp_form_show): New var.
15181 (syms_of_keyboard): Use DEFSYM macro.
15183 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15185 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15187 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15189 * process.c (Flist_processes): Remove to Lisp.
15190 (list_processes_1): Delete.
15192 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15194 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15196 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15198 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15200 Fix more problems found by GCC 4.6.0's static checks.
15202 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15204 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15206 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15208 * xdisp.c (vmessage): Mark as a printf-like function.
15210 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15212 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15214 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15215 printf-like functions.
15216 (tiff_load): Add casts to remove these marks before passing them
15217 to system-supplied API.
15219 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15221 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15222 This avoids several warnings with gcc -Wstrict-overflow.
15223 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15224 directly, rather than having caller test rule sign. This avoids
15225 some unnecessary tests.
15226 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15227 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15228 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15230 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15231 (xfont_open): Avoid unnecessary tests.
15233 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15235 * composite.h, composite.c (composition_gstring_put_cache):
15236 Use EMACS_INT, not int, for length.
15238 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15239 breaking out part of COMPOSITION_DECODE_RULE.
15240 (COMPOSITION_DECODE_RULE): Use it.
15241 * composite.c (get_composition_id): Remove unused local vars,
15242 by using the new macro.
15244 * textprop.c (set_text_properties_1): Change while to do-while,
15245 since the condition is always true at first.
15247 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15248 (interval_deletion_adjustment): Return unsigned value.
15251 * process.c (list_processes_1, create_pty, read_process_output):
15252 (exec_sentinel): Remove vars that were set but not used.
15253 (create_pty): Remove unnecessary "volatile"s.
15254 (Fnetwork_interface_info): Avoid possibility of int overflow.
15255 (read_process_output): Do adaptive read buffering even if carryover.
15256 (read_process_output): Simplify nbytes computation if buffered.
15258 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15260 * syntax.c (scan_words): Remove var that was set but not used.
15261 (update_syntax_table): Use unsigned instead of int.
15263 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15264 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15265 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15267 * print.c (print_error_message): Avoid int overflow.
15269 * font.c (font_list_entities): Redo for clarity,
15270 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15272 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15273 (font_score): Avoid potential overflow in diff calculation.
15275 * fns.c (substring_both): Remove var that is set but not used.
15276 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15278 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15280 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15281 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15282 can always succeed if overflow has undefined behavior.
15284 * search.c (boyer_moore, wordify): Remove vars set but not used.
15285 (wordify): Omit three unnecessary tests.
15287 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15288 All callers changed. This avoids the need for an unused var.
15290 * casefiddle.c (casify_region): Remove var that is set but not used.
15292 * dired.c (file_name_completion): Remove var that is set but not used.
15294 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15296 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15297 (Finsert_file_contents): Remove unnecessary code checking fd.
15299 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15300 Check for integer overflow on size calculations.
15302 * buffer.c (Fprevious_overlay_change): Remove var that is set
15305 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15306 Remove vars that are set but not used.
15307 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
15308 (timer_check_2): Mark vars as initialized.
15310 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15312 * image.c (lookup_image): Remove var that is set but not used.
15313 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
15315 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15316 that are set but not used.
15318 * xfns.c (make_invisible_cursor): Don't return garbage
15319 if XCreateBitmapFromData fails (Bug#8410).
15321 * xselect.c (x_get_local_selection, x_handle_property_notify):
15322 Remove vars that are set but not used.
15324 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15325 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15327 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15328 Remove var that is set but not used.
15329 (scroll_bar_windows_size): Now size_t, not int.
15330 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15331 Check for overflow.
15333 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15334 (map_tty_color) [!defined MSDOS]: Likewise.
15336 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15338 * coding.c: Remove vars that are set but not used.
15339 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15340 All callers changed.
15341 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15342 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15343 (decode_coding_charset): Remove vars that are set but not used.
15345 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15346 that is set but not used.
15348 * print.c (print_object): Remove var that is set but not used.
15350 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
15351 The gnulib version avoids calling malloc in the usual case,
15352 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15353 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15354 * filelock.c (current_lock_owner): Likewise.
15355 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15356 * sysdep.c: Include allocator.h, careadlinkat.h.
15357 (emacs_no_realloc_allocator): New static constant.
15358 (emacs_readlink): New function.
15359 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15360 ../lib/careadlinkat.h.
15362 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15364 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15365 first non-nil return value).
15367 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15369 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15370 if not defined (Bug#8403).
15372 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15374 * xdisp.c (display_count_lines): Remove parameter `start',
15375 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15376 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15377 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15378 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15379 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15380 and thereabouts. All callers changed.
15381 (get_per_char_metric): Remove parameter `f', unused since
15382 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15384 2011-04-02 Jim Meyering <meyering@redhat.com>
15386 do not dereference NULL upon failed strdup
15387 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15388 (ns_get_family): Likewise.
15390 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15392 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15394 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15396 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15399 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15401 Add lexical binding.
15403 * window.c (Ftemp_output_buffer_show): New fun.
15404 (Fsave_window_excursion):
15405 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15407 * lread.c (lisp_file_lexically_bound_p): New function.
15408 (Fload): Bind Qlexical_binding.
15409 (readevalloop): Remove `evalfun' arg.
15410 Bind Qinternal_interpreter_environment.
15411 (Feval_buffer): Bind Qlexical_binding.
15412 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15414 (syms_of_lread): Declare `lexical-binding'.
15416 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15418 * keyboard.c (eval_dyn): New fun.
15419 (menu_item_eval_property): Use it.
15421 * image.c (parse_image_spec): Use Ffunctionp.
15423 * fns.c (concat, mapcar1): Accept byte-code-functions.
15425 * eval.c (Fsetq): Handle lexical vars.
15426 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15427 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15428 (FletX, Flet): Obey lexical binding.
15429 (Fcommandp): Handle closures.
15430 (Feval): New `lexical' arg.
15431 (eval_sub): New function extracted from Feval. Use it almost
15432 everywhere where Feval was used. Look up vars in lexical env.
15434 (Ffunctionp): Move from subr.el.
15435 (Ffuncall): Handle closures.
15436 (apply_lambda): Remove `eval_flags'.
15437 (funcall_lambda): Handle closures and new byte-code-functions.
15438 (Fspecial_variable_p): New function.
15439 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15440 but without exporting it to Lisp.
15442 * doc.c (Fdocumentation, store_function_docstring):
15443 * data.c (Finteractive_form): Handle closures.
15445 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15448 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15450 (exec_byte_code): New function extracted from Fbyte_code to handle new
15451 calling convention for byte-code-functions. Add new byte-codes.
15453 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
15455 * alloc.c (Fmake_symbol): Init new `declared_special' field.
15457 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15459 * xdisp.c (redisplay_internal): Fix prototype.
15461 2011-03-31 Eli Zaretskii <eliz@gnu.org>
15463 * xdisp.c (SCROLL_LIMIT): New macro.
15464 (try_scrolling): Use it when setting scroll_limit.
15465 Limit scrolling to 100 screen lines.
15466 (redisplay_window): Even when falling back on "recentering",
15467 position point in the window according to scroll-conservatively,
15468 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15470 (try_scrolling): When point is above the window, allow searching
15471 as far as scroll_max, or one screenful, to compute vertical
15472 distance from PT to the scroll margin position. This prevents
15473 try_scrolling from unnecessarily failing when
15474 scroll-conservatively is set to a value slightly larger than the
15475 window height. Clean up the case of PT below the margin at bottom
15476 of window: scroll_max can no longer be INT_MAX. When aggressive
15477 scrolling is in use, don't let point enter the opposite scroll
15478 margin as result of the scroll.
15479 (syms_of_xdisp) <scroll-conservatively>: Document the
15480 threshold of 100 lines for never-recentering scrolling.
15482 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15484 * dispextern.h (move_it_by_lines):
15485 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15486 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15487 (message_log_check_duplicate): Remove parameters `prev_bol' and
15488 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15489 (redisplay_internal): Remove parameter `preserve_echo_area',
15490 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15492 * indent.c (Fvertical_motion):
15493 * window.c (window_scroll_pixel_based, Frecenter):
15494 Don't pass `need_y_p' to `move_it_by_lines'.
15496 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15498 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15499 steal a few bits to be more compact.
15500 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15501 Remove unneeded casts.
15503 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15505 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15507 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15508 binding" message (bug#7967).
15510 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15512 Fix more problems found by GCC 4.6.0's static checks.
15514 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15515 Remove unused local var.
15517 * editfns.c (Fmessage_box): Remove unused local var.
15519 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15520 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15521 Omit unused local vars.
15522 * window.c (shrink_windows): Omit unused local var.
15523 * menu.c (digest_single_submenu): Omit unused local var.
15524 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15525 Omit unused local var.
15527 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15528 Don't assume string length fits in int.
15529 (keyremap_step, read_key_sequence): Use size_t for sizes.
15530 (read_key_sequence): Don't check last_real_key_start redundantly.
15532 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15533 instead of alloca (Bug#8344).
15535 * eval.c (Fbacktrace): Don't assume nargs fits in int.
15536 (Fbacktrace_frame): Don't assume nframes fits in int.
15538 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15540 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15543 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15545 * cm.c (calccost): Turn while-do into do-while, for clarity.
15547 * keyboard.c (syms_of_keyboard): Use the same style as later
15548 in this function when indexing through an array. This also
15549 works around GCC bug 48267.
15551 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15553 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15555 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15556 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15558 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15559 This avoids undefined behavior on integer overflow, and is a bit
15560 more convenient anyway since it is compared to a size_t variable.
15562 Variadic C functions now count arguments with size_t, not int.
15563 This avoids an unnecessary limitation on 64-bit machines, which
15564 caused (substring ...) to crash on large vectors (Bug#8344).
15565 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15566 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
15567 All variadic functions and their callers changed accordingly.
15568 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15569 * data.c (arith_driver, float_arith_driver): Likewise.
15570 * editfns.c (general_insert_function): Likewise.
15571 * eval.c (struct backtrace.nargs, interactive_p)
15572 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15573 (funcall_lambda, mark_backtrace): Likewise.
15574 * fns.c (concat): Likewise.
15575 * frame.c (x_set_frame_parameters): Likewise.
15576 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15577 0 if not found, not -1. All callers changed.
15579 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15580 (stack_copy_size): Now size_t, not int.
15581 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15583 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15585 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15586 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15587 All callers changed.
15589 * lisp.h (multibyte_char_to_unibyte):
15590 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15591 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15592 * character.h (CHAR_TO_BYTE8):
15593 * cmds.c (internal_self_insert):
15594 * editfns.c (general_insert_function):
15595 * keymap.c (push_key_description):
15596 * search.c (Freplace_match):
15597 * xdisp.c (message_dolog, set_message_1): All callers changed.
15599 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15601 * keyboard.c (safe_run_hook_funcall): New function.
15602 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15603 don't set the hook to nil, but remove the offending function instead.
15604 (Qcommand_hook_internal): Remove, unused.
15605 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15606 Vcommand_hook_internal.
15608 * eval.c (enum run_hooks_condition): Remove.
15609 (funcall_nil, funcall_not): New functions.
15610 (run_hook_with_args): Call each function through a `funcall' argument.
15611 Remove `cond' argument, now redundant.
15612 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15613 (Frun_hook_with_args_until_failure): Adjust accordingly.
15614 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15616 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15618 * dispextern.h (string_buffer_position): Remove declaration.
15620 * print.c (strout): Remove parameter `multibyte', unused since
15621 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15623 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15624 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15625 All callers changed.
15627 * w32.c (_wsa_errlist): Use braces for struct initializers.
15629 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15630 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15631 All callers changed.
15632 (string_buffer_position): Likewise. Also, make static (it's never
15633 used outside xdisp.c).
15634 (cursor_row_p): Remove parameter `w', unused since
15635 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15636 (decode_mode_spec): Remove parameter `precision', introduced during
15637 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15638 All callers changed.
15640 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15642 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15644 2011-03-27 Anders Lindgren <andlind@gmail.com>
15646 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15647 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15648 (ns_update_auto_hide_menu_bar): New functions.
15649 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15650 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15651 ns_constrain_all_frames.
15652 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15653 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15655 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15657 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15659 2011-03-27 Glenn Morris <rgm@gnu.org>
15661 * syssignal.h: Replace RETSIGTYPE with void.
15662 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15663 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15664 Replace SIGTYPE with void everywhere.
15665 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15666 * s/template.h (SIGTYPE): Remove commented out definition.
15668 2011-03-26 Eli Zaretskii <eliz@gnu.org>
15670 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15671 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15673 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
15675 * w32.c (read_unc_volume): Use parameter `henum', instead of
15676 global variable `wget_enum_handle'.
15678 * keymap.c (describe_vector): Remove parameters `indices' and
15679 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15680 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15682 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15684 * keyboard.c (timer_check): Remove parameter `do_it_now',
15685 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15686 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15687 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15689 * keyboard.c (read_char):
15690 * w32menu.c (w32_menu_display_help):
15691 * xmenu.c (show_help_event, menu_help_callback):
15692 Adjust calls to `show_help_echo'.
15694 * gtkutil.c (xg_maybe_add_timer):
15695 * keyboard.c (readable_events):
15696 * process.c (wait_reading_process_output):
15697 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15699 * insdel.c (adjust_markers_gap_motion):
15700 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15701 (gap_left, gap_right): Don't call it.
15703 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
15705 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15706 incurred during fontification.
15708 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15710 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15711 (DEFVAR_PER_BUFFER): Don't pass it.
15713 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15714 (scrolling_window): Don't pass it.
15716 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15718 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15720 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15722 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15723 of variables specific to SELinux and computation of `encoded_absname'.
15725 * image.c (XPutPixel): Remove unused variable `height'.
15727 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15729 * unexw32.c (get_section_info): Remove unused variable `section'.
15731 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15732 (system_process_attributes): Remove unused variable `sess'.
15733 (sys_read): Remove unused variable `err'.
15735 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15736 (w32_wnd_proc): Remove unused variable `isdead'.
15737 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15738 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15739 (x_create_tip_frame): Remove unused variable `tem'.
15741 * w32inevt.c (w32_console_read_socket):
15742 Remove unused variable `no_events'.
15744 * w32term.c (x_draw_composite_glyph_string_foreground):
15745 Remove unused variable `width'.
15747 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
15749 * w32term.c (x_set_glyph_string_clipping):
15750 Don't pass uninitialized region to CombineRgn.
15752 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
15754 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15755 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15756 (Fx_close_connection): Remove unused variable `i'.
15758 * w32font.c (w32font_draw): Return number of glyphs.
15759 (w32font_open_internal): Remove unused variable `i'.
15760 (w32font_driver): Add missing initializer.
15762 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15763 (fill_in_menu): Remove unused variable `items_added'.
15765 * w32term.c (last_mouse_press_frame): Remove static global variable.
15766 (w32_clip_to_row): Remove unused variable `f'.
15767 (x_delete_terminal): Remove unused variable `i'.
15769 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15770 (NOTHING): Remove unused static global variable.
15771 (uniscribe_check_otf): Remove unused variable `table'.
15772 (uniscribe_font_driver): Add missing initializers.
15774 2011-03-23 Julien Danjou <julien@danjou.info>
15776 * term.c (Fsuspend_tty, Fresume_tty):
15777 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15778 * window.c (temp_output_buffer_show):
15779 * insdel.c (signal_before_change):
15780 * frame.c (Fhandle_switch_frame):
15781 * fileio.c (Fdo_auto_save):
15782 * emacs.c (Fkill_emacs):
15783 * editfns.c (save_excursion_restore):
15784 * cmds.c (internal_self_insert):
15785 * callint.c (Fcall_interactively):
15786 * buffer.c (Fkill_all_local_variables):
15787 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15789 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
15790 unconditionally since it does the check itself.
15792 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
15794 Fix more problems found by GCC 4.5.2's static checks.
15796 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15797 the first time through the loop, since we know p0 < p1 then.
15798 This also avoids a gcc -Wstrict-overflow warning.
15800 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15801 leading to a memory leak, possible in functions like
15802 load_charset_map_from_file that can allocate an unbounded number
15803 of objects (Bug#8318).
15805 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15806 that could (at least in theory) be that large.
15808 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15809 This is less likely to overflow, and avoids undefined behavior if
15810 overflow does occur. All callers changed. Use strtoul to scan
15811 for the unsigned long integer.
15812 (pint2hrstr): Simplify and tune code slightly.
15813 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
15815 * scroll.c (do_scrolling): Work around GCC bug 48228.
15816 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15818 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15819 This also avoids a warning with gcc -Wstrict-overflow.
15820 (validate_x_resource_name): Simplify count usage.
15821 This also avoids a warning with gcc -Wstrict-overflow.
15823 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15826 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
15828 * process.c (Fmake_network_process): Use socklen_t, not int,
15829 where POSIX says socklen_t is required in portable programs.
15830 This fixes a porting bug on hosts like 64-bit HP-UX, where
15831 socklen_t is wider than int (Bug#8277).
15832 (Fmake_network_process, server_accept_connection):
15833 (wait_reading_process_output, read_process_output):
15836 * process.c: Rename or move locals to avoid shadowing.
15837 (list_processes_1, Fmake_network_process):
15838 (read_process_output_error_handler, exec_sentinel_error_handler):
15839 Rename or move locals.
15840 (Fmake_network_process): Define label "retry_connect" only if needed.
15841 (Fnetwork_interface_info): Fix pointer signedness.
15842 (process_send_signal): Add cast to avoid pointer signedness problem.
15843 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
15844 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
15846 Make tparam.h and terminfo.c consistent.
15847 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15848 Include tparam.h instead, since it declares them.
15849 * cm.h (PC): Remove extern decl; tparam.h now does this.
15850 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15851 * terminfo.c: Include tparam.h, to check interfaces.
15852 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15853 (tparam): Adjust signature to match interface in tparam.h;
15854 this removes some undefined behavior. Check that outstring and len
15855 are zero, which they always are with Emacs.
15856 * tparam.h (PC, BC, UP): New extern decls.
15858 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
15859 (xftfont_open): Rename locals to avoid shadowing.
15861 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
15862 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15863 (OTF_TAG_SYM): Omit macro if not needed.
15864 (ftfont_list): Remove unused local.
15865 (get_adstyle_property, ftfont_pattern_entity):
15866 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15867 Rename locals to avoid shadowing.
15869 * xfont.c (xfont_list_family): Mark var as initialized.
15871 * xml.c (make_dom): Now static.
15873 * composite.c (composition_compute_stop_pos): Rename local to
15875 (composition_reseat_it): Remove unused locals.
15876 (find_automatic_composition, composition_adjust_point): Likewise.
15877 (composition_update_it): Mark var as initialized.
15878 (find_automatic_composition): Mark vars as initialized,
15879 with a FIXME (Bug#8290).
15881 character.h: Rename locals to avoid shadowing.
15882 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15883 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15884 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15885 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15886 to avoid shadowing.
15888 * textprop.c (property_change_between_p): Remove; unused.
15890 * intervals.c (interval_start_pos): Now static.
15892 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15894 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15895 Rename locals to avoid shadowing.
15897 * sound.c (wav_play, au_play, Fplay_sound_internal):
15898 Fix pointer signedness.
15899 (alsa_choose_format): Remove unused local var.
15900 (wav_play): Initialize a variable to 0, to prevent undefined
15901 behavior (Bug#8278).
15903 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15905 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15907 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15908 clobbering (Bug#8298).
15909 * sysdep.c (sys_subshell): Likewise.
15910 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
15912 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15913 This should get cleaned up, so that child_setup has the
15914 same signature on all platforms.
15916 * callproc.c (call_process_cleanup): Now static.
15917 (relocate_fd): Rename locals to avoid shadowing.
15919 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
15921 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15922 not to be necessary, and produces flickering.
15924 2011-03-20 Glenn Morris <rgm@gnu.org>
15926 * config.in: Remove file.
15928 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
15930 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15931 are now in src/globals.h.
15932 (syms_of_minibuf): Remove spurious & from previous change.
15934 2011-03-20 Leo Liu <sdl.web@gmail.com>
15936 * minibuf.c (completing-read-function): New variable.
15937 (completing-read-default): Rename from completing-read.
15938 (completing-read): Call completing-read-function.
15940 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15942 * xfaces.c (Fx_load_color_file):
15943 Read color file from absolute filename (bug#8250).
15945 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15947 * makefile.w32-in: Update dependencies.
15949 2011-03-17 Eli Zaretskii <eliz@gnu.org>
15951 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15953 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15955 Fix more problems found by GCC 4.5.2's static checks.
15957 * process.c (make_serial_process_unwind, send_process_trap):
15958 (sigchld_handler): Now static.
15960 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15961 That way, the code declares only the vars that it needs.
15962 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15963 * s/cygwin.h (PTY_ITERATION): Likewise.
15964 * s/darwin.h (PTY_ITERATION): Likewise.
15965 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15967 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15968 * process.c (allocate_pty): Don't declare stb unless it's needed.
15970 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
15971 (CONSTANTLIM): Remove; unused.
15972 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15973 Define only if needed.
15975 * unexelf.c (unexec): Name an expression,
15976 to avoid gcc -Wbad-function-cast warning.
15977 Use a different way to cause a compilation error if anyone uses
15978 n rather than nn, a way that does not involve shadowing.
15979 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
15981 * deps.mk (unexalpha.o): Remove; unused.
15983 New file unexec.h, the (simple) interface for unexec (Bug#8267).
15984 * unexec.h: New file.
15985 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15986 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15987 Depend on unexec.h.
15988 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15989 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15990 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
15991 Change as necessary to match prototype in unexec.h.
15993 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15995 (back_comment, skip_chars): Mark vars as initialized.
15997 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15998 Rename locals to avoid shadowing.
16000 * lread.c (read1): Rewrite so as not to use empty "else".
16001 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16003 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16005 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16006 warning when compiling print.c.
16008 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16009 instead of using an uninitialized var.
16010 (font_sort_entities): Mark var as initialized.
16012 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16014 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16015 pointers to constants.
16016 (font_parse_fcname): Remove unused vars.
16017 (font_delete_unmatched): Now static.
16018 (font_get_spec): Remove; unused.
16019 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16020 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16021 Rename or move locals to avoid shadowing.
16023 * fns.c (require_nesting_list, require_unwind): Now static.
16024 (Ffillarray): Rename locals to avoid shadowing.
16026 * floatfns.c (domain_error2): Define only if needed.
16027 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16029 * alloc.c (mark_backtrace): Move decl from here ...
16030 * lisp.h: ... to here, so that it can be checked.
16032 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16033 (Fdefvar): Rewrite so as not to use empty "else".
16034 (lisp_indirect_variable): Name an expression,
16035 to avoid gcc -Wbad-function-cast warning.
16036 (Fdefvar): Rename locals to avoid shadowing.
16038 * callint.c (quotify_arg, quotify_args): Now static.
16039 (Fcall_interactively): Rename locals to avoid shadowing.
16040 Use const pointer when appropriate.
16042 * lisp.h (get_system_name, get_operating_system_release):
16043 Move decls here, to check interfaces.
16044 * process.c (get_operating_system_release): Move decl to lisp.h.
16045 * xrdb.c (get_system_name): Likewise.
16046 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16047 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16048 some of which prompt warnings from gcc -Wbad-function-cast.
16049 (Fformat_time_string, Fencode_time, Finsert_char):
16050 (Ftranslate_region_internal, Fformat):
16051 Rename or remove local vars to avoid shadowing.
16052 (Ftranslate_region_internal): Mark var as initialized.
16054 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16057 * lisp.h (eassert): Check that the argument compiles, even if
16058 ENABLE_CHECKING is not defined.
16060 * data.c (Findirect_variable): Name an expression, to avoid
16061 gcc -Wbad-function-cast warning.
16062 (default_value, arithcompare, arith_driver, arith_error): Now static.
16063 (store_symval_forwarding): Rename local to avoid shadowing.
16064 (Fmake_variable_buffer_local, Fmake_local_variable):
16065 Mark variables as initialized.
16066 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16068 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16069 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16070 Rename locals to avoid shadowing.
16071 (mark_stack): Move local variables into the #ifdef region where
16073 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16074 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16076 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16077 (GC_STRING_CHARS): Remove; not used.
16078 (Fmemory_limit): Cast sbrk's returned value to char *.
16080 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16081 avoids undefined behavior in theory.
16083 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16085 Use functions, not macros, for up- and down-casing (Bug#8254).
16086 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16087 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16088 to use the following functions instead of these macros.
16089 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16090 EMACS_INT, since callers assume the returned value fits in int.
16091 (upcase1): Likewise, for UPCASE_TABLE.
16092 (uppercasep, lowercasep, upcase): New static inline functions.
16093 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16094 the race-condition problem in the old DOWNCASE.
16096 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16097 Rename locals to avoid shadowing.
16098 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16099 (regex_compile, re_search_2, re_match_2_internal):
16100 Remove unused local vars.
16101 (FREE_VAR): Rewrite so as not to use empty "else",
16102 which gcc can warn about.
16103 (regex_compile, re_match_2_internal): Mark locals as initialized.
16104 (RETALLOC_IF): Define only if needed.
16105 (WORDCHAR_P): Likewise. This one is never needed, but is used
16106 only in a comment talking about a compiler bug, so put inside
16107 the #if 0 of that comment.
16108 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16109 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16112 * search.c (boyer_moore): Rename locals to avoid shadowing.
16113 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16114 (PREV_CHAR_BOUNDARY): Likewise.
16116 * search.c (simple_search): Remove unused var.
16118 * dired.c (compile_pattern): Move decl from here ...
16119 * lisp.h: ... to here, so that it can be checked.
16120 (struct re_registers): New forward decl.
16122 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16124 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16126 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16127 Rename locals to avoid shadowing.
16128 (Fvertical_motion): Mark locals as initialized.
16130 * casefiddle.c (casify_object, casify_region): Now static.
16131 (casify_region): Mark local as initialized.
16133 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16135 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16136 New macros, so that the caller can use some names other than
16137 gcpro1, gcpro2, etc.
16138 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16140 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16141 argument, for consistency with GCPRO2_VAR, etc: it is now the
16142 prefix of the variable, not the variable itself. All uses
16144 * dired.c (directory_files_internal, file_name_completion):
16145 Rename locals to avoid shadowing.
16147 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16148 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16149 dired.c's scmp function, had undefined behavior.
16150 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16151 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16152 * buffer.h: ... to here, because these macros use current_buffer,
16153 and the new implementation with inline functions needs to have
16154 current_buffer in scope now, rather than later when the macros
16156 (downcase, upcase1): New static inline functions.
16157 (DOWNCASE, UPCASE1): Reimplement using these functions.
16158 This avoids undefined behavior in expressions like
16159 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16160 from race conditions in accessing the global variables
16161 case_temp1 and case_temp2.
16162 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16163 * lisp.h (case_temp1, case_temp2): Remove their decls.
16164 * character.h (ASCII_CHAR_P): Move from here ...
16165 * lisp.h: ... to here, so that the inline functions mentioned
16166 above can use them.
16168 * dired.c (directory_files_internal_unwind): Now static.
16170 * fileio.c (file_name_as_directory, directory_file_name):
16171 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16173 (file_name_as_directory): Use const pointers when appropriate.
16174 (Fexpand_file_name): Likewise. In particular, newdir might
16175 point at constant storage, so make it a const pointer.
16176 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16177 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16179 (Fset_file_times, Finsert_file_contents, auto_save_error):
16180 Rename locals to avoid shadowing.
16182 * minibuf.c (choose_minibuf_frame_1): Now static.
16183 (Ftry_completion, Fall_completions): Rename or remove locals
16184 to avoid shadowing.
16186 * marker.c (bytepos_to_charpos): Remove; unused.
16188 * lisp.h (verify_bytepos, count_markers): New decls,
16189 so that gcc does not warn that these functions aren't declared.
16191 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16192 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16193 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16194 (copy_text): Remove unused local var.
16196 * filelock.c (within_one_second): Now static.
16197 (lock_file_1): Rename local to avoid shadowing.
16199 * buffer.c (fix_overlays_before): Mark locals as initialized.
16200 (fix_start_end_in_overlays): Likewise. This function should be
16201 simplified by using pointers-to-pointers, but that's a different
16203 (switch_to_buffer_1): Now static.
16204 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16205 (report_overlay_modification): Rename locals to avoid shadowing.
16207 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16208 Fix pointer signedness issue.
16209 (sys_subshell): Mark local as volatile if checking for lint,
16210 to suppress a gcc -Wclobbered warning that does not seem to be right.
16211 (MAXPATHLEN): Define only if needed.
16213 * process.c (serial_open, serial_configure): Move decls from here ...
16214 * systty.h: ... to here, so that they can be checked.
16216 * fns.c (get_random, seed_random): Move extern decls from here ...
16217 * lisp.h: ... to here, so that they can be checked.
16219 * sysdep.c (reset_io): Now static.
16220 (wait_for_termination_signal): Remove; unused.
16222 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16223 (copy_keymap_item, append_key, push_text_char_description):
16225 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16226 (DENSE_TABLE_SIZE): Remove; unused.
16227 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16228 (describe_map_tree):
16229 Rename locals to avoid shadowing.
16231 * keyboard.c: Declare functions static if they are not used elsewhere.
16232 (echo_char, echo_dash, cmd_error, top_level_2):
16233 (poll_for_input, handle_async_input): Now static.
16234 (read_char, kbd_buffer_get_event, make_lispy_position):
16235 (make_lispy_event, make_lispy_movement, apply_modifiers):
16236 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16237 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16238 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
16239 (read_key_sequence, read_char): Mark locals as initialized.
16240 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
16242 * keyboard.h (make_ctrl_char): New decl.
16243 (mark_kboards): Move decl here ...
16244 * alloc.c (mark_kboards): ... from here.
16246 * lisp.h (force_auto_save_soon): New decl.
16248 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
16249 (DEFINE_DUMMY_FUNCTION): New macro.
16250 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16252 (main): Add casts to avoid warnings
16253 if GCC considers string literals to be constants.
16255 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16257 * dbusbind.c: Pointer signedness fixes.
16258 (xd_signature, xd_append_arg, xd_initialize):
16259 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16260 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16261 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16262 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16264 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16265 if GCC considers string literals to be constants.
16266 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16268 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16270 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16271 (print_preprocess, print_object): New macro to fix last change.
16273 * print.c (print_preprocess): Don't forget font objects.
16275 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16277 * emacs.c (USAGE3): Doc fixes.
16279 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16281 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16284 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
16286 * lisp.h (VWindow_system, Qfile_name_history):
16287 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16288 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16289 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16291 * w32select.c: Don't #include "keyboard.h".
16292 (run_protected): Add extern declaration for waiting_for_input.
16294 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16295 * w32console.c (detect_input_pending, read_input_pending)
16296 (encode_terminal_code):
16297 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16298 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16299 (w32_system_caret_y, Qfile_name_history):
16300 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16301 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16302 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16303 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16304 * w32proc.c (Qlocal, report_file_error):
16305 * w32term.c (Vwindow_system, updating_frame):
16306 * w32uniscribe.c (initialized, uniscribe_font_driver):
16307 Remove unneeded extern declarations.
16309 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
16311 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16313 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
16315 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16316 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16317 These macros can no longer be used for assignment.
16319 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16320 Assign struct members directly, instead of using BUF_BEGV etc.
16321 (record_buffer_markers, fetch_buffer_markers): New functions for
16322 recording and fetching special buffer markers.
16323 (set_buffer_internal_1, set_buffer_temp): Use them.
16325 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16327 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16329 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16330 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16332 * xdisp.c (hscroll_window_tree):
16333 (reconsider_clip_changes): Use PT instead of BUF_PT.
16335 2011-03-13 Eli Zaretskii <eliz@gnu.org>
16337 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16338 $(EMACS_ROOT)/lib/intprops.h.
16340 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16342 Fix more problems found by GCC 4.5.2's static checks.
16344 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16345 to unsigned char * to avoid compiler diagnostic.
16346 (xg_free_frame_widgets): Make it clear that a local variable is
16347 needed only if USE_GTK_TOOLTIP.
16348 (gdk_window_get_screen): Make it clear that this macro is needed
16349 only if USE_GTK_TOOLTIP.
16350 (int_gtk_range_get_value): New function, which avoids a diagnostic
16351 from gcc -Wbad-function-cast.
16352 (xg_set_toolkit_scroll_bar_thumb): Use it.
16353 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16354 diagnostic from gcc -Wbad-function-cast.
16355 (get_utf8_string, xg_get_file_with_chooser):
16356 Rename locals to avoid shadowing.
16357 (create_dialog): Move locals to avoid shadowing.
16359 * xgselect.c (xg_select): Remove unused var.
16361 * image.c (four_corners_best): Mark locals as initialized.
16362 (gif_load): Initialize transparent_p to zero (Bug#8238).
16363 Mark another local as initialized.
16364 (my_png_error, my_error_exit): Mark with NO_RETURN.
16366 * image.c (clear_image_cache): Now static.
16367 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
16368 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
16369 (x_edge_detection): Remove unnecessary cast that
16370 gcc -Wbad-function-cast diagnoses.
16371 (gif_load): Fix pointer signedness.
16372 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16373 (jpeg_load, gif_load): Rename locals to avoid shadowing.
16375 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
16377 Improve quality of tests for time stamp overflow.
16378 For example, without this patch (encode-time 0 0 0 1 1
16379 1152921504606846976) returns the obviously-bogus value (-948597
16380 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16381 reports time overflow. See
16382 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16383 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16384 * editfns.c: Include limits.h and intprops.h.
16385 (TIME_T_MIN, TIME_T_MAX): New macros.
16386 (time_overflow): Move earlier, to before first use.
16387 (hi_time, lo_time): New functions, for an accurate test for
16388 out-of-range times.
16389 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16390 (Fget_internal_run_time): Don't assume time_t fits in int.
16391 (make_time): Use list2 instead of Fcons twice.
16392 (Fdecode_time): More accurate test for out-of-range times.
16393 (check_tm_member): New function.
16394 (Fencode_time): Use it, to test for out-of-range times.
16395 (lisp_time_argument): Don't rely on undefined left-shift and
16396 right-shift behavior when checking for time stamp overflow.
16398 * editfns.c (time_overflow): New function, refactoring common code.
16399 (Fformat_time_string, Fdecode_time, Fencode_time):
16400 (Fcurrent_time_string): Use it.
16402 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16403 * dired.c (make_time): Move to ...
16404 * editfns.c (make_time): ... here.
16405 * systime.h: Note the move.
16407 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16409 * fringe.c (update_window_fringes): Remove unused variables.
16411 * unexmacosx.c (copy_data_segment): Also copy __got section.
16414 2011-03-12 Eli Zaretskii <eliz@gnu.org>
16416 * termcap.c [MSDOS]: Include "msdos.h".
16417 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16418 Constify `char *' arguments and their references according to
16419 prototypes in tparam.h.
16421 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
16423 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16424 Adapt all references accordingly.
16426 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16428 2011-03-11 Tom Tromey <tromey@redhat.com>
16430 * buffer.c (syms_of_buffer): Remove obsolete comment.
16432 2011-03-11 Eli Zaretskii <eliz@gnu.org>
16434 * termhooks.h (encode_terminal_code): Declare prototype.
16436 * msdos.c (encode_terminal_code): Don't declare prototype.
16438 * term.c (encode_terminal_code): Now external again, used by
16439 w32console.c and msdos.c.
16441 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16442 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
16444 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
16446 Fix some minor problems found by GCC 4.5.2's static checks.
16448 * fringe.c (update_window_fringes): Mark locals as initialized
16450 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
16452 * alloc.c (mark_fringe_data): Move decl from here ...
16453 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16454 to check its interface.
16455 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16457 * fontset.c (free_realized_fontset): Now static.
16458 (Fset_fontset_font): Rename local to avoid shadowing.
16459 (fontset_font): Mark local as initialized.
16460 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
16462 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16464 * xselect.c (x_disown_buffer_selections): Remove; not used.
16465 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
16466 (x_own_selection, Fx_disown_selection_internal): Rename locals
16467 to avoid shadowing.
16468 (x_handle_dnd_message): Remove local to avoid shadowing.
16470 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16471 so that the caller can use some name other than gcpro1.
16472 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
16473 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16474 (Fx_backspace_delete_keys_p):
16475 Use them to avoid shadowing, and rename vars to avoid shadowing.
16476 (x_decode_color, x_set_name, x_window): Now static.
16477 (Fx_create_frame): Add braces to silence GCC warning.
16478 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
16479 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16480 Remove unused locals.
16481 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16482 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16483 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16486 * xterm.h (x_mouse_leave): New decl.
16488 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16489 Remove unused functions.
16490 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16491 (x_calc_absolute_position): Now static.
16492 (XTread_socket): Don't define label "out" unless it's used.
16493 Don't declare local "event" unless it's used.
16494 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16495 unless they are used.
16496 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16497 (x_fatal_error_signal): Remove; not used.
16498 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16499 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16500 (x_error_catcher, x_connection_closed, x_error_handler):
16501 (x_error_quitter, xembed_send_message, x_iconify_frame):
16502 (my_log_handler): Rename locals to avoid shadowing.
16503 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
16504 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
16506 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16507 Rename or move locals to avoid shadowing.
16508 (tty_defined_color, merge_face_heights): Now static.
16509 (free_realized_faces_for_fontset): Remove; not used.
16510 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16511 does not deduce is never used uninitialized.
16512 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16513 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
16515 * terminal.c (store_terminal_param): Now static.
16517 * xmenu.c (menu_highlight_callback): Now static.
16518 (set_frame_menubar): Remove unused local.
16519 (xmenu_show): Rename parameter to avoid shadowing.
16520 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16521 since they might point to immutable storage.
16522 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16523 since it's unused otherwise.
16525 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
16526 Add a FIXME, since the code still doesn't look right. (Bug#8215)
16527 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16528 avoids a gcc -Wuninitialized diagnostic.
16529 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
16530 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16531 does not deduce are never used uninitialized.
16533 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16535 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
16536 * window.c (window_loop, size_window):
16537 (run_window_configuration_change_hook, enlarge_window): Likewise.
16539 * window.c (display_buffer): Now static.
16540 (size_window): Mark variables that gcc -Wuninitialized
16541 does not deduce are never used uninitialized.
16542 * window.h (check_all_windows): New decl, to forestall
16543 gcc -Wmissing-prototypes diagnostic.
16544 * dispextern.h (bidi_dump_cached_states): Likewise.
16546 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16548 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
16549 Include <limits.h>.
16550 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16551 and to avoid gcc -Wuninitialized warning.
16552 (load_charset_map): Mark variables that gcc -Wuninitialized
16553 does not deduce are never used uninitialized.
16554 (load_charset): Abort instead of using uninitialized var (Bug#8229).
16556 * coding.c (coding_set_source, coding_set_destination):
16557 Use "else { /* comment */ }" rather than "else /* comment */;"
16558 for clarity, and to avoid gcc -Wempty-body warning.
16559 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16560 a block, when the outer 'i' will do.
16561 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16562 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16563 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16564 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16565 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16566 Rename locals to avoid shadowing.
16567 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
16568 * coding.c (emacs_mule_char, encode_invocation_designation):
16569 Now static, since they're not used elsewhere.
16570 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
16571 (decode_coding_object, encode_coding_object, detect_coding_system):
16572 (decode_coding_emacs_mule): Mark variables that gcc
16573 -Wuninitialized does not deduce are never used uninitialized.
16574 (detect_coding_iso_2022): Initialize a local variable that might
16575 be used uninitialized. Leave a FIXME because it's not clear that
16576 this initialization is needed. (Bug#8211)
16577 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16578 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16579 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16580 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16581 Remove unused macros.
16583 * category.c (hash_get_category_set): Remove unused local var.
16584 (copy_category_table): Now static, since it's not used elsewhere.
16585 * character.c (string_count_byte8): Likewise.
16587 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16588 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16590 * chartab.c (copy_sub_char_table): Now static, since it's not used
16592 (sub_char_table_ref_and_range, char_table_ref_and_range):
16593 Rename locals to avoid shadowing.
16594 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
16596 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
16597 (BIDI_BOB): Remove unused macro.
16599 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16600 deduce are never used uninitialized.
16601 * term.c (encode_terminal_code): Likewise.
16603 * term.c (encode_terminal_code): Now static. Remove unused local.
16605 * tparam.h: New file.
16606 * term.c, tparam.h: Include it.
16607 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16608 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16609 Move these decls to tparam.h, and make them agree with what
16610 is actually in tparam.c. The previous trick of using incompatible
16611 decls in different modules does not conform to the C standard.
16612 All callers of tparam changed to use tparam's actual API.
16613 * tparam.c (tparam1, tparam, tgoto):
16614 Use const pointers where appropriate.
16616 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16617 * cm.h (struct cm): Likewise.
16618 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16619 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16620 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16621 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16622 (turn_on_face, init_tty): Likewise.
16623 * termchar.h (struct tty_display_info): Likewise.
16625 * term.c (term_mouse_position): Rename local to avoid shadowing.
16627 * alloc.c (mark_ttys): Move decl from here ...
16628 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16630 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16632 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16634 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
16636 * search.c (compile_pattern_1): Remove argument regp, unused since
16637 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16638 (compile_pattern): Don't pass it.
16640 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16642 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16643 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16645 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16647 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16649 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16650 gdk_window_get_screen, gdk_window_get_geometry,
16651 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16652 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16653 (xg_get_pixbuf_from_pixmap): New function.
16654 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16655 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16656 Call xg_get_pixbuf_from_pixmap instead of
16657 gdk_pixbuf_get_from_drawable.
16658 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16659 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16660 (xg_check_special_colors): Use GtkStyleContext and its functions
16662 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16663 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16664 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
16665 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16666 Call gtk_widget_get_preferred_size.
16667 (xg_frame_resized): gdk_window_get_geometry only takes 5
16669 (xg_win_to_widget, xg_event_is_for_menubar):
16670 Call gdk_x11_window_lookup_for_display.
16671 (xg_set_widget_bg): New function.
16672 (delete_cb): New function.
16673 (xg_create_frame_widgets): Connect delete-event to delete_cb.
16674 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
16675 (xg_set_background_color): Call xg_set_widget_bg.
16676 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16677 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16678 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16679 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16681 (update_frame_tool_bar): Call gtk_widget_hide.
16682 (xg_initialize): Use GDK_KEY_g.
16684 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16686 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16688 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16689 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16690 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16692 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
16694 * w32xfns.c (select_palette): Check success of RealizePalette against
16695 GDI_ERROR, not zero.
16697 See ChangeLog.11 for earlier changes.
16699 ;; Local Variables:
16703 Copyright (C) 2011-2012 Free Software Foundation, Inc.
16705 This file is part of GNU Emacs.
16707 GNU Emacs is free software: you can redistribute it and/or modify
16708 it under the terms of the GNU General Public License as published by
16709 the Free Software Foundation, either version 3 of the License, or
16710 (at your option) any later version.
16712 GNU Emacs is distributed in the hope that it will be useful,
16713 but WITHOUT ANY WARRANTY; without even the implied warranty of
16714 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16715 GNU General Public License for more details.
16717 You should have received a copy of the GNU General Public License
16718 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.